From 4c9f30a869740ce94283b4f774df099e00d1210d Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Fri, 9 Aug 2019 12:30:23 +0800 Subject: [PATCH] cmake: set component properties --- tools/ci/test_build_system_cmake.sh | 8 ++++++++ tools/cmake/component.cmake | 2 ++ 2 files changed, 10 insertions(+) diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index 5b2828d84..bbe299b92 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -510,6 +510,14 @@ endmenu\n" >> ${IDF_PATH}/Kconfig; mv CMakeLists.txt.bak CMakeLists.txt rm -rf CMakeLists.txt.bak + print_status "Component properties are set" + clean_build_dir + cp CMakeLists.txt CMakeLists.txt.bak + printf "\nidf_component_get_property(srcs main SRCS)\nmessage(STATUS SRCS:\${srcs})" >> CMakeLists.txt + (idf.py reconfigure | grep "SRCS:$(realpath main/main.c)") || failure "Component properties should be set" + rm -rf CMakeLists.txt + mv CMakeLists.txt.bak CMakeLists.txt + rm -rf CMakeLists.txt.bak print_status "All tests completed" if [ -n "${FAILURES}" ]; then diff --git a/tools/cmake/component.cmake b/tools/cmake/component.cmake index 6959af26c..21950dee9 100644 --- a/tools/cmake/component.cmake +++ b/tools/cmake/component.cmake @@ -479,6 +479,8 @@ function(idf_component_register) # COMPONENT_TARGET is deprecated but is made available with same function # as COMPONENT_LIB for compatibility. set(COMPONENT_TARGET ${component_lib} PARENT_SCOPE) + + __component_set_properties() endfunction() #