arch/posix/CMakeLists.txt: Move comment to correct place

This comment "moved" over the years as more code was added.
Let's put it where it belongs, and simplify it a bit.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2025-03-10 16:45:35 +01:00 committed by Benjamin Cabé
commit 5c4be68b3c

View file

@ -75,6 +75,10 @@ if (CONFIG_NATIVE_APPLICATION)
zephyr_compile_options( zephyr_compile_options(
-include ${ZEPHYR_BASE}/arch/posix/include/posix_cheats.h -include ${ZEPHYR_BASE}/arch/posix/include/posix_cheats.h
) )
# About this -include directive: The reason to do it this way, is because in this
# manner it is transparent to the application. Otherwise posix_cheats.h needs to
# be included in all the applications' files which define main( ), and in any
# app file which uses any of the APIs renamed in that header.
elseif (CONFIG_NATIVE_LIBRARY) elseif (CONFIG_NATIVE_LIBRARY)
zephyr_compile_options( zephyr_compile_options(
-fvisibility=hidden -fvisibility=hidden
@ -146,14 +150,6 @@ if (CONFIG_NATIVE_APPLICATION)
) )
endif() endif()
# About the -include directive: The reason to do it this way, is because in this
# manner it is transparent to the application. Otherwise posix_cheats.h needs to
# be included in all the applications' files which define main( ), and in any
# app file which uses the pthreads like API provided by Zephyr
# ( include/posix/pthread.h / kernel/pthread.c ) [And any future API added to
# Zephyr which will clash with the native POSIX API] . It would also need to
# be included in a few zephyr kernel files.
# #
# Support for the LLVM Sanitizer toolchain instrumentation frameworks # Support for the LLVM Sanitizer toolchain instrumentation frameworks
# (supported by current gcc's as well) # (supported by current gcc's as well)