diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-09 13:11:25 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-10-15 18:22:20 +0200 |
commit | 1e498976cfe8e9ad88cea83bcba5e119a726b3fc (patch) | |
tree | b755f255ab216664b747ec1453d5a4884e6dbfd3 /reference/etc/macros.cmake | |
parent | 724626233e38f3edac8dba45b2eb488674a12f3b (diff) |
Check compiler version to ensure a minimal version.
Change-Id: I619ba2c41e9e5f46b1d10d31510794b6577fce85
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'reference/etc/macros.cmake')
-rw-r--r-- | reference/etc/macros.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/reference/etc/macros.cmake b/reference/etc/macros.cmake index 184f8ba..b8c4e06 100644 --- a/reference/etc/macros.cmake +++ b/reference/etc/macros.cmake @@ -40,6 +40,14 @@ macro(PROJECT_TARGET_ADD TARGET_NAME) endif() endmacro(PROJECT_TARGET_ADD) +# Check GCC minimal version version +if (gcc_minimal_version) + message ("-- Check gcc_minimal_version (found gcc version ${CMAKE_C_COMPILER_VERSION}) (found g++ version ${CMAKE_CXX_COMPILER_VERSION})") +if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version} OR CMAKE_C_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version}) + message(FATAL_ERROR "**** FATAL: Require at least gcc-${gcc_minimal_version} please set CMAKE_C[XX]_COMPILER") +endif() +endif(gcc_minimal_version) + macro(defstr name value) add_definitions(-D${name}=${value}) endmacro(defstr) |