mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(host_test): use ${project_elf} variable and keyword link form
Three host_test CMakeLists.txt files relied on idioms tied to a
specific build system layout. Make them portable:
- spiffs/host_test and esp_partition/host_test/partition_api_test
passed a hard-coded "<project>.elf" target name to add_dependencies().
Use ${project_elf}, the canonical variable that resolves to the live
executable target name in either build system.
- nvs_flash/host_test/nvs_page_test linked --coverage using the plain
signature of target_link_libraries. CMake forbids mixing plain and
keyword signatures on the same target; the component library link
already uses the keyword form. Switch the --coverage link to the
keyword signature.
This commit is contained in:
@@ -8,7 +8,7 @@ idf_component_register(SRCS "nvs_page_test.cpp"
|
||||
PRIV_REQUIRES spi_flash)
|
||||
|
||||
target_compile_options(${COMPONENT_LIB} PUBLIC --coverage)
|
||||
target_link_libraries(${COMPONENT_LIB} --coverage)
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC --coverage)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE -std=gnu++20)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user