arch posix: Do not define standard SOURCE macros globally

Do not define these macros globally, but instead
define them only for this library and when needed.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-12-28 11:57:42 +01:00 committed by Anas Nashif
parent 404db20877
commit ca68ef7e5a
2 changed files with 2 additions and 2 deletions

View file

@ -133,8 +133,6 @@ if (CONFIG_GPROF)
target_link_options(native_simulator INTERFACE "-pg")
endif()
zephyr_compile_definitions(_POSIX_C_SOURCE=200809L _XOPEN_SOURCE=600 _XOPEN_SOURCE_EXTENDED)
if (CONFIG_NATIVE_APPLICATION)
zephyr_ld_options(
-ldl

View file

@ -28,6 +28,8 @@ if(CONFIG_NATIVE_APPLICATION)
${ZEPHYR_BASE}/scripts/native_simulator/common/src/nce.c
${ZEPHYR_BASE}/scripts/native_simulator/common/src/nsi_host_trampolines.c
)
zephyr_library_compile_definitions(_POSIX_C_SOURCE=200809L _XOPEN_SOURCE=600 _XOPEN_SOURCE_EXTENDED)
else()
zephyr_library_sources(
posix_core_nsi.c