cmake: Fix some failing example builds, fix gcov
This commit is contained in:
parent
4b23d70eec
commit
b38a6da74b
|
@ -24,3 +24,5 @@ register_component()
|
||||||
# disable --coverage for this component, as it is used as transport
|
# disable --coverage for this component, as it is used as transport
|
||||||
# for gcov
|
# for gcov
|
||||||
component_compile_options("-fno-profile-arcs" "-fno-test-coverage")
|
component_compile_options("-fno-profile-arcs" "-fno-test-coverage")
|
||||||
|
|
||||||
|
target_link_libraries(app_trace gcov)
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
# BT config
|
# BT config
|
||||||
#
|
#
|
||||||
CONFIG_BT_ENABLED=y
|
CONFIG_BT_ENABLED=y
|
||||||
CONFIG_BT_ENABLED=y
|
|
||||||
CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y
|
CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y
|
||||||
CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=
|
CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=
|
||||||
CONFIG_BTDM_CONTROLLER_MODE_BTDM=
|
CONFIG_BTDM_CONTROLLER_MODE_BTDM=
|
||||||
|
|
|
@ -302,7 +302,7 @@ esptool.py v2.1-beta1
|
||||||
)";
|
)";
|
||||||
|
|
||||||
const char* flash_output[] = {
|
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
|
esptool.py v2.1-beta1
|
||||||
Connecting....
|
Connecting....
|
||||||
)",
|
)",
|
||||||
|
@ -334,7 +334,7 @@ Hard resetting...
|
||||||
|
|
||||||
const char* monitor_output =
|
const char* monitor_output =
|
||||||
R"(MONITOR
|
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 --
|
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --
|
||||||
)" LOG_RESET_COLOR;
|
)" LOG_RESET_COLOR;
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,9 @@ It will enable coverage info for all source files of your component. If you need
|
||||||
`gcov_example.o: CFLAGS += --coverage`
|
`gcov_example.o: CFLAGS += --coverage`
|
||||||
Replace `gcov_example.o` with path to your file.
|
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
|
### 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.
|
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.
|
||||||
|
|
|
@ -3,3 +3,7 @@ set(COMPONENT_SRCS "gcov_example.c"
|
||||||
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
||||||
|
|
||||||
register_component()
|
register_component()
|
||||||
|
|
||||||
|
set_source_files_properties(gcov_example.c
|
||||||
|
PROPERTIES COMPILE_FLAGS
|
||||||
|
--coverage)
|
||||||
|
|
|
@ -2,7 +2,5 @@
|
||||||
# in this exact order for cmake to work correctly
|
# in this exact order for cmake to work correctly
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
set(MAIN_SRCS main/light_sleep_example_main.c)
|
|
||||||
|
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
project(light_sleep_example)
|
project(light_sleep_example)
|
||||||
|
|
4
examples/system/light_sleep/main/CMakeLists.txt
Normal file
4
examples/system/light_sleep/main/CMakeLists.txt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
set(COMPONENT_SRCS "light_sleep_example_main.c")
|
||||||
|
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
||||||
|
|
||||||
|
register_component()
|
|
@ -1,10 +1,9 @@
|
||||||
set(COMPONENT_SRCS "native_ota_example.c")
|
set(COMPONENT_SRCS "native_ota_example.c")
|
||||||
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
||||||
|
|
||||||
|
|
||||||
# Embed the server root certificate into the final binary
|
# Embed the server root certificate into the final binary
|
||||||
#
|
#
|
||||||
# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.)
|
# (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()
|
register_component()
|
||||||
|
|
|
@ -5,7 +5,6 @@ set(COMPONENT_ADD_INCLUDEDIRS ".")
|
||||||
# Embed the server root certificate into the final binary
|
# Embed the server root certificate into the final binary
|
||||||
#
|
#
|
||||||
# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.)
|
# (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()
|
register_component()
|
||||||
|
|
|
@ -88,8 +88,8 @@ else
|
||||||
[ -z ${NUM_OF_JOBS} ] && die "NUM_OF_JOBS is bad"
|
[ -z ${NUM_OF_JOBS} ] && die "NUM_OF_JOBS is bad"
|
||||||
|
|
||||||
# count number of examples
|
# count number of examples
|
||||||
NUM_OF_EXAMPLES=$(echo ${EXAMPLE_PATHS} | wc -l )
|
NUM_OF_EXAMPLES=$( echo "${EXAMPLE_PATHS}" | wc -l )
|
||||||
[ -z ${NUM_OF_EXAMPLES} ] && die "NUM_OF_EXAMPLES is bad"
|
[ ${NUM_OF_EXAMPLES} -lt 100 ] && die "NUM_OF_EXAMPLES is bad"
|
||||||
|
|
||||||
# separate intervals
|
# separate intervals
|
||||||
#57 / 5 == 12
|
#57 / 5 == 12
|
||||||
|
|
Loading…
Reference in a new issue