]> granicus.if.org Git - esp-idf/commitdiff
cmake: project includes should know about ESP_PLATFORM variable
authorRenz Christian Bagaporo <renz@espressif.com>
Mon, 20 May 2019 07:07:15 +0000 (15:07 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Mon, 20 May 2019 10:24:34 +0000 (18:24 +0800)
CMakeLists.txt
tools/cmake/build.cmake

index 139dce9c65291b96f5dc46b2f43df5fe5073e7ff..beccd08a63dd880ddaf5ce67f2993157ec3c6d56 100644 (file)
@@ -62,9 +62,6 @@ elseif(CONFIG_STACK_CHECK_ALL)
     list(APPEND compile_options "-fstack-protector-all")
 endif()
 
-# All targets built under this scope is with the ESP-IDF build system
-set(ESP_PLATFORM 1)
-list(APPEND compile_definitions "-DESP_PLATFORM")
 
 idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)
 idf_build_set_property(C_COMPILE_OPTIONS "${c_compile_options}" APPEND)
index e20b68cc48c9e2c846c865ab4a957b789807203c..531d343c2a93f308cbecf439d0f1937939064000 100644 (file)
@@ -443,12 +443,18 @@ macro(idf_build_process target)
         idf_build_set_property(___COMPONENT_REQUIRES_COMMON ${lib} APPEND)
     endforeach()
 
+    # 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)
+
     __build_process_project_includes()
 
     # Perform component processing (inclusion of project_include.cmake, adding component
     # subdirectories, creating library targets, linking libraries, etc.)
     idf_build_get_property(idf_path IDF_PATH)
     add_subdirectory(${idf_path} ${build_dir}/esp-idf)
+
+    unset(ESP_PLATFORM)
 endmacro()
 
 # idf_build_executable