]> granicus.if.org Git - esp-idf/commitdiff
cmake: Fix some failing example builds, fix gcov
authorAngus Gratton <angus@espressif.com>
Tue, 18 Sep 2018 04:23:56 +0000 (14:23 +1000)
committerAngus Gratton <gus@projectgus.com>
Wed, 19 Sep 2018 04:38:19 +0000 (14:38 +1000)
components/app_trace/CMakeLists.txt
examples/bluetooth/ble_spp_server/sdkconfig.defaults
examples/system/console/main/cmd_system.c
examples/system/gcov/README.md
examples/system/gcov/main/CMakeLists.txt
examples/system/light_sleep/CMakeLists.txt
examples/system/light_sleep/main/CMakeLists.txt [new file with mode: 0644]
examples/system/ota/native_ota_example/main/CMakeLists.txt
examples/system/ota/simple_ota_example/main/CMakeLists.txt
tools/ci/build_examples_cmake.sh

index 711a50e50a7ef1c69e5bba423a81a6f603f74a1f..151015021a7d0ac7d52ffb41f4e16c6c5c01c619 100644 (file)
@@ -24,3 +24,5 @@ register_component()
 # disable --coverage for this component, as it is used as transport
 # for gcov
 component_compile_options("-fno-profile-arcs" "-fno-test-coverage")
+
+target_link_libraries(app_trace gcov)
index 696a01a199b5fdf62938c6283534803fd29518c4..87546674f8ec7e1f4ed21e06501b0b755b4f2330 100644 (file)
@@ -5,7 +5,6 @@
 # BT config
 #
 CONFIG_BT_ENABLED=y
-CONFIG_BT_ENABLED=y
 CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y
 CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=
 CONFIG_BTDM_CONTROLLER_MODE_BTDM=
index e1aee57d7631b06ed3f466a257ab756234c47617..3bfa7f02893c7d32ac25c74a2a74d1a48499ce80 100644 (file)
@@ -302,7 +302,7 @@ esptool.py v2.1-beta1
 )";
 
     const char* flash_output[] = {
-R"(Flashing binaries to serial port )" CONFIG_ESPTOOLPY_PORT R"( (app at offset 0x10000)...
+R"(Flashing binaries to serial port (*) (app at offset 0x10000)...
 esptool.py v2.1-beta1
 Connecting....
 )",
@@ -334,7 +334,7 @@ Hard resetting...
 
     const char* monitor_output =
 R"(MONITOR
-)" LOG_COLOR_W R"(--- idf_monitor on )" CONFIG_ESPTOOLPY_PORT R"( 115200 ---
+)" LOG_COLOR_W R"(--- idf_monitor on (*) 115200 ---
 --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --
 )" LOG_RESET_COLOR;
 
index 5eefed2d5245c7a138165591ec2fdb1441241e4d..1115146cc0bfffecb65d7ce4c6a689e0b18a47c3 100644 (file)
@@ -25,6 +25,9 @@ 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 `component_compile_options(--coverage)` or: `  set_source_files_properties(gcov_example.c PROPERTIES COMPILE_FLAGS --coverage`
+
+
 ### Hard-coded Dump Call
 
 This method requires `esp_gcov_dump` to be called from your application's code. Below are additional steps which should be performed after the generic ones to obtain coverage info via hard-coded call. Step 1 is already done for this example project.
index 170d5c55214a90288d181748731c6796d2d41e65..8c9cbd3eaf0b6aa261fa8e36884357237fd6f73c 100644 (file)
@@ -3,3 +3,7 @@ set(COMPONENT_SRCS "gcov_example.c"
 set(COMPONENT_ADD_INCLUDEDIRS ".")
 
 register_component()
+
+set_source_files_properties(gcov_example.c
+    PROPERTIES COMPILE_FLAGS
+    --coverage)
index 33b3fec26996464cf5f233a6d4070bf08a5a982c..ed39e967141584542693098521e305d62ad58f55 100644 (file)
@@ -2,7 +2,5 @@
 # in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS main/light_sleep_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(light_sleep_example)
diff --git a/examples/system/light_sleep/main/CMakeLists.txt b/examples/system/light_sleep/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..fc813fb
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "light_sleep_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index f7e58ac26a8fcc5117f2958425ddfe6220eb8510..0c4aeba941c3a1e7492730a8afac3db9d0e22bd9 100644 (file)
@@ -1,10 +1,9 @@
 set(COMPONENT_SRCS "native_ota_example.c")
 set(COMPONENT_ADD_INCLUDEDIRS ".")
 
-
 # Embed the server root certificate into the final binary
 #
 # (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.)
-set(COMPONENT_EMBED_TXTFILES ../../server_certs/ca_cert.pem)
+set(COMPONENT_EMBED_TXTFILES ${IDF_PATH}/examples/system/ota/server_certs/ca_cert.pem)
 
 register_component()
index 6d7b303916210cc64e01de6b4e7504d088dfc34e..e54d8b2ce40d9d899c35571b52e93e675ac9f5e5 100644 (file)
@@ -5,7 +5,6 @@ set(COMPONENT_ADD_INCLUDEDIRS ".")
 # Embed the server root certificate into the final binary
 #
 # (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.)
-set(COMPONENT_EMBED_TXTFILES ../../server_certs/ca_cert.pem)
-
+set(COMPONENT_EMBED_TXTFILES ${IDF_PATH}/examples/system/ota/server_certs/ca_cert.pem)
 
 register_component()
index d86d30fbd97d4c66c2fcbe3c32d17db385438246..39840a38568622da5aa08306c4e0b64fce9d176d 100755 (executable)
@@ -88,8 +88,8 @@ else
     [ -z ${NUM_OF_JOBS} ] && die "NUM_OF_JOBS is bad"
 
     # count number of examples
-    NUM_OF_EXAMPLES=$(echo ${EXAMPLE_PATHS} | wc -l )
-    [ -z ${NUM_OF_EXAMPLES} ] && die "NUM_OF_EXAMPLES is bad"
+    NUM_OF_EXAMPLES=$( echo "${EXAMPLE_PATHS}" | wc -l )
+    [ ${NUM_OF_EXAMPLES} -lt 100 ] && die "NUM_OF_EXAMPLES is bad"
 
     # separate intervals
     #57 / 5 == 12