]> granicus.if.org Git - esp-idf/commitdiff
cmake: make project includes know gcc version as well
authorRenz Christian Bagaporo <renz@espressif.com>
Thu, 23 May 2019 10:20:43 +0000 (18:20 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Thu, 23 May 2019 10:39:31 +0000 (18:39 +0800)
CMakeLists.txt
tools/cmake/build.cmake

index ec96655dc20b01c04a326d15f9d965afe8f2f696..8b38b6aa4476ba0faed72cd7cc7b1e83a3107a6d 100644 (file)
@@ -9,15 +9,6 @@ unset(compile_definitions)
 # Add the following build specifications here, since these seem to be dependent
 # on config values on the root Kconfig.
 
-# Temporary trick to support both gcc5 and gcc8 builds
-if(CMAKE_C_COMPILER_VERSION VERSION_EQUAL 5.2.0)
-    set(GCC_NOT_5_2_0 0 CACHE STRING "GCC is 5.2.0 version")
-else()
-    set(GCC_NOT_5_2_0 1 CACHE STRING "GCC is not 5.2.0 version")
-endif()
-
-list(APPEND compile_definitions "-DGCC_NOT_5_2_0=${GCC_NOT_5_2_0}")
-
 if(CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE)
     list(APPEND compile_options "-Os")
 else()
index af335d3f1e55ad18c09d0c5230f8c7a43ed3eddc..306486c165c030dfd2a7dfbc9589940c0fe7ab46 100644 (file)
@@ -442,6 +442,14 @@ macro(idf_build_process target)
         idf_build_set_property(___COMPONENT_REQUIRES_COMMON ${lib} APPEND)
     endforeach()
 
+    # Temporary trick to support both gcc5 and gcc8 builds
+    if(CMAKE_C_COMPILER_VERSION VERSION_EQUAL 5.2.0)
+        set(GCC_NOT_5_2_0 0 CACHE STRING "GCC is 5.2.0 version")
+    else()
+        set(GCC_NOT_5_2_0 1 CACHE STRING "GCC is not 5.2.0 version")
+    endif()
+    idf_build_set_property(COMPILE_DEFINITIONS "-DGCC_NOT_5_2_0" APPEND)
+
     # All targets built under this scope is with the ESP-IDF build system
     set(ESP_PLATFORM 1)
     idf_build_set_property(COMPILE_DEFINITIONS "-DESP_PLATFORM" APPEND)