Workaround for link libraries call on Zephyr platform (#1145)

zephyr_link_interface() does not work as intended because the
implementation in zephyr/cmake/modules/extensions.cmake:

function(zephyr_link_interface interface)
  target_link_libraries(${interface} INTERFACE zephyr_interface)
endfunction()

is backwards, i.e., target_link_libraries(etl INTERFACE zephyr_interface)
vs. target_link_libraries(zephyr_interface INTERFACE etl).

The workaround results in the following CMake code being executed:

target_link_libraries(zephyr_interface INTERFACE etl::etl)
This commit is contained in:
wandns 2025-07-10 09:17:01 +00:00 committed by GitHub
parent 7535d9b63a
commit dc6f028b99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
if(CONFIG_ETL)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/.. etl)
zephyr_link_interface(etl)
zephyr_link_libraries(etl::etl)
zephyr_compile_definitions_ifdef(CONFIG_ETL_DEBUG ETL_DEBUG)
zephyr_compile_definitions_ifdef(CONFIG_ETL_CHECK_PUSH_POP ETL_CHECK_PUSH_POP)