cmake: Also build C++ files as no-pic

Seems it may have been lost during refactoring
that C++ code should also be built as not
position independent code to save space.
Let's enable it just like for plain C.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-05-04 13:43:41 +02:00 committed by Carles Cufí
commit 01348d38ca

View file

@ -383,6 +383,7 @@ zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,
# @Intent: Do not make position independent code / executable
zephyr_compile_options($<$<COMPILE_LANGUAGE:C>:$<TARGET_PROPERTY:compiler,no_position_independent>>)
zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler,no_position_independent>>)
zephyr_link_libraries($<TARGET_PROPERTY:linker,no_position_independent>)
# Allow the user to inject options when calling cmake, e.g.