]> granicus.if.org Git - esp-idf/commitdiff
cmake: set component properties
authorRenz Christian Bagaporo <renz@espressif.com>
Fri, 9 Aug 2019 04:30:23 +0000 (12:30 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Fri, 9 Aug 2019 12:51:20 +0000 (20:51 +0800)
tools/ci/test_build_system_cmake.sh
tools/cmake/component.cmake

index 5b2828d84a30d3498c95c4ebc3d114e526dfd772..bbe299b92ff1d2953a601cd0a1bf2a836fbc81bc 100755 (executable)
@@ -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
index 6959af26c2619913db57fa713396b92023488329..21950dee97b7034b9753a0076d90eec2f947c4b4 100644 (file)
@@ -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()
 
 #