cmake: project includes should know about ESP_PLATFORM variable

This commit is contained in:
Renz Christian Bagaporo 2019-05-20 15:07:15 +08:00
parent e3eb945fd2
commit e1726a91ce
2 changed files with 6 additions and 3 deletions

View 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)

View 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