mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
examples: update with build system changes
This commit is contained in:
parent
ffec9d4947
commit
d214bb912f
@ -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()
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user