]> granicus.if.org Git - esp-idf/commitdiff
cmake: Put a variable to the cache to have access one in other cmake files
authorAnton Maklakov <anton@espressif.com>
Wed, 5 Dec 2018 12:03:25 +0000 (20:03 +0800)
committerAnton Maklakov <anton@espressif.com>
Thu, 13 Dec 2018 04:29:27 +0000 (12:29 +0800)
tools/cmake/idf_functions.cmake

index e8cd828325d3d3fbbf11cb41184477e3591f7f83..0a3af7e0375a33785218a36491fc0ea29359a40f 100644 (file)
@@ -76,10 +76,11 @@ endmacro()
 function(idf_set_global_compile_options)
     # 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)
+        set(GCC_NOT_5_2_0 0 CACHE STRING "GCC is 5.2.0 version")
     else()
-        set(GCC_NOT_5_2_0 1)
+        set(GCC_NOT_5_2_0 1 CACHE STRING "GCC is not 5.2.0 version")
     endif()
+    list(APPEND compile_definitions "GCC_NOT_5_2_0=${GCC_NOT_5_2_0}")
 
     list(APPEND compile_definitions "ESP_PLATFORM" "HAVE_CONFIG_H")
 
@@ -178,9 +179,6 @@ function(idf_set_global_compile_options)
     list(APPEND cxx_compile_options ${EXTRA_CXXFLAGS})
     list(APPEND compile_options ${EXTRA_CPPFLAGS})
 
-    # Temporary trick to support both gcc5 and gcc8 builds
-    list(APPEND compile_definitions "GCC_NOT_5_2_0=${GCC_NOT_5_2_0}")
-
     set_default(IDF_COMPILE_DEFINITIONS "${compile_definitions}")
     set_default(IDF_COMPILE_OPTIONS "${compile_options}")
     set_default(IDF_C_COMPILE_OPTIONS "${c_compile_options}")