]> granicus.if.org Git - esp-idf/commitdiff
examples: update with build system changes
authorRenz Christian Bagaporo <renz@espressif.com>
Fri, 26 Apr 2019 09:51:48 +0000 (17:51 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Tue, 14 May 2019 10:01:14 +0000 (18:01 +0800)
examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt
examples/build_system/cmake/import_lib/CMakeLists.txt
examples/build_system/cmake/import_lib/main/CMakeLists.txt
examples/mesh/manual_networking/main/CMakeLists.txt
examples/system/gcov/README.md
examples/system/ota/advanced_https_ota/main/CMakeLists.txt
examples/system/ota/native_ota_example/main/CMakeLists.txt
examples/system/ota/simple_ota_example/main/CMakeLists.txt
tools/ci/test_build_system_cmake.sh

index 1969d3995bb622a2f5486634af861ef469a00de6..6445d3c5efb7489e5ce2e57a2ba70383751746c9 100644 (file)
@@ -7,5 +7,5 @@ set(COMPONENT_ADD_INCLUDEDIRS ".")
 register_component()
 
 if(GCC_NOT_5_2_0)
-    component_compile_options(-Wno-unused-const-variable)
+    target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-const-variable)
 endif()
index e145bd43aed503511056905311c43c9d7149fc27..5194df11c79279dd376dd6a3e1f88dc7eabb56f5 100644 (file)
@@ -3,4 +3,4 @@
 cmake_minimum_required(VERSION 3.5)
 
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(import_cmake_lib)
+project(import_lib)
index 92d44e3249dc976923e66ae9eb3975bfbe0ee312..8111cbe6a38fb287973443bdf2e4cb605deb46d0 100644 (file)
@@ -9,13 +9,18 @@ register_component()
 option(BUILD_SHARED_LIBS OFF)
 option(BUILD_TESTING OFF)
 
+# Unfortunately the library performs install and export. Would 
+# have been nice if devs made that an option like BUILD_SHARED_LIBS
+# and BUILD_TESTING. Override install() and export() to do nothing
+# instead.
+function(install)
+endfunction()
+
+function(export)
+endfunction()
+
 # Import tinyxml2 targets 
 add_subdirectory(lib/tinyxml2)
 
-# Propagate compile settings to tinyxml2
-target_include_directories(tinyxml2 PRIVATE ${IDF_INCLUDE_DIRECTORIES})
-target_compile_options(tinyxml2 PRIVATE "${IDF_COMPILE_OPTIONS}")
-target_compile_options(tinyxml2 PRIVATE "${IDF_CXX_COMPILE_OPTIONS}")
-
 # Link tinyxml2 to main component
-target_link_libraries(${COMPONENT_TARGET} tinyxml2)
+target_link_libraries(${COMPONENT_LIB} tinyxml2)
index 451eeceed64681f17e97d6e6e66a3c175b7d6c01..1ae57b28ac60f113df382288d6d11be04e73bcd8 100644 (file)
@@ -1,5 +1,5 @@
 set(COMPONENT_SRCS "mesh_light.c"
                    "mesh_main.c")
-set(COMPONENT_ADD_INCLUDEDIRS ". include")
+set(COMPONENT_ADD_INCLUDEDIRS "." "include")
 
 register_component()
index 8faf9f31e328dae6fb1c57d74b92a39fcdc40011..de20784184c75102d35306e381416b1f9b72b53d 100644 (file)
@@ -25,7 +25,7 @@ It will enable coverage info for all source files of your component. If you need
 `gcov_example.o: CFLAGS += --coverage`
 Replace `gcov_example.o` with path to your file.
 
-  For CMake-based build system, use `target_compile_options(${COMPONENT_TARGET} PRIVATE --coverage)` or: `  set_source_files_properties(gcov_example.c PROPERTIES COMPILE_FLAGS --coverage`
+  For CMake-based build system, use `target_compile_options(${COMPONENT_LIB} PRIVATE --coverage)` or: `  set_source_files_properties(gcov_example.c PROPERTIES COMPILE_FLAGS --coverage`
 
 
 ### Hard-coded Dump Call
index 2b2b10728d4b58a7df95375b4e603fc7041b7684..19abec788c176b297ac9f7ba89bceae2e2022198 100644 (file)
@@ -3,6 +3,7 @@ set(COMPONENT_ADD_INCLUDEDIRS ".")
 
 
 # Embed the server root certificate into the final binary
-set(COMPONENT_EMBED_TXTFILES ${IDF_PROJECT_PATH}/server_certs/ca_cert.pem)
+idf_build_get_property(project_dir PROJECT_DIR)
+set(COMPONENT_EMBED_TXTFILES ${project_dir}/server_certs/ca_cert.pem)
 
 register_component()
index fa4644e4556f88c7634dd0f89a9e4d228d7cc4a7..1e5d1ed0f58a05ea7690954e25e22ca818c1a289 100644 (file)
@@ -2,6 +2,7 @@ set(COMPONENT_SRCS "native_ota_example.c")
 set(COMPONENT_ADD_INCLUDEDIRS ".")
 
 # Embed the server root certificate into the final binary
-set(COMPONENT_EMBED_TXTFILES ${IDF_PROJECT_PATH}/server_certs/ca_cert.pem)
+idf_build_get_property(project_dir PROJECT_DIR)
+set(COMPONENT_EMBED_TXTFILES ${project_dir}/server_certs/ca_cert.pem)
 
 register_component()
index 98a7208f86a2a79f9c06f0bd473a1e189a121373..c5db485effc3d05195d38bd1613b21b50cbdd6c5 100644 (file)
@@ -3,6 +3,7 @@ set(COMPONENT_ADD_INCLUDEDIRS ".")
 
 
 # Embed the server root certificate into the final binary
-set(COMPONENT_EMBED_TXTFILES ${IDF_PROJECT_PATH}/server_certs/ca_cert.pem)
+idf_build_get_property(project_dir PROJECT_DIR)
+set(COMPONENT_EMBED_TXTFILES ${project_dir}/server_certs/ca_cert.pem)
 
 register_component()
index fa7b60609504713e3a601d006fa95224f115b045..016b50d03094bb6b8958c649ad6aa1d4088274db 100755 (executable)
@@ -58,7 +58,7 @@ function run_tests()
     BOOTLOADER_BINS="bootloader/bootloader.elf bootloader/bootloader.bin"
     APP_BINS="app-template.elf app-template.bin"
     PARTITION_BIN="partition_table/partition-table.bin"
-    IDF_COMPONENT_PREFIX="idf_component"
+    IDF_COMPONENT_PREFIX="__idf"
 
     print_status "Initial clean build"
     # if build fails here, everything fails