posix arch cmake: Add clarification on use of target_link_options

Clarify why we use target_link_options() instead of
target_link_libraries()

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-07-05 17:41:51 +02:00 committed by Carles Cufí
commit ee268a6d4b

View file

@ -19,6 +19,12 @@ endif()
# For ex. target_sources(native_simulator INTERFACE silly.c)
# Note that these are built with the host libC and the include directories
# the runner is built with.
# Note: target_link_libraries() cannot be used on this library at this point.
# target_link_libraries() updates INTERFACE_LINK_LIBRARIES but wrapping it with extra
# information. This means we cannot directly pass it to the native_simulator runner build.
# Check https://cmake.org/cmake/help/latest/prop_tgt/INTERFACE_LINK_LIBRARIES.html for more
# info.
# We use target_link_options() instead
add_library(native_simulator INTERFACE)
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${CMAKE_HOST_SYSTEM_NAME}.${CMAKE_HOST_SYSTEM_PROCESSOR}.cmake)