summaryrefslogtreecommitdiffstats
path: root/cmake/cmake.d
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-06-14 11:16:39 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:22:48 +0200
commitde552fb43fe9cbb51eaa9458b6565a6a70ed1db3 (patch)
tree457bafc86280dd154c89edcc88b280234c9c1c83 /cmake/cmake.d
parentfc45cd7826aa588491143a216457f90b572d5ef5 (diff)
02-variables.cmake: Avoid checking CXX version if not required
Change-Id: Id5a8987d3222df9cfaa258cdce8353dad6ca9a4a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'cmake/cmake.d')
-rw-r--r--cmake/cmake.d/02-variables.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/cmake.d/02-variables.cmake b/cmake/cmake.d/02-variables.cmake
index dc1c313..693991a 100644
--- a/cmake/cmake.d/02-variables.cmake
+++ b/cmake/cmake.d/02-variables.cmake
@@ -103,7 +103,7 @@ set(AFB_REMPORT "1234" CACHE PATH "Default AFB_TOKEN")
if (gcc_minimal_version)
message (STATUS "${Cyan}-- Check gcc_minimal_version (found gcc version ${CMAKE_C_COMPILER_VERSION}) \
(found g++ version ${CMAKE_CXX_COMPILER_VERSION})${ColourReset}")
-if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version} OR CMAKE_C_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version})
+if (("${PROJECT_LANGUAGES}" MATCHES "CXX" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version}) OR CMAKE_C_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version})
message(FATAL_ERROR "${Red}**** FATAL: Require at least gcc-${gcc_minimal_version} please set CMAKE_C[XX]_COMPILER")
endif()
endif(gcc_minimal_version)