From e1726a91ce7e11ffe707b1070b856171cf4baaad Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Mon, 20 May 2019 15:07:15 +0800 Subject: [PATCH] cmake: project includes should know about ESP_PLATFORM variable --- CMakeLists.txt | 3 --- tools/cmake/build.cmake | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 139dce9c6..beccd08a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/tools/cmake/build.cmake b/tools/cmake/build.cmake index e20b68cc4..531d343c2 100644 --- a/tools/cmake/build.cmake +++ b/tools/cmake/build.cmake @@ -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