1# SPDX-License-Identifier: Apache-2.0
2
3zephyr_library()
4zephyr_library_compile_definitions(NO_POSIX_CHEATS)
5zephyr_library_sources(
6	cpuhalt.c
7	fatal.c
8	irq.c
9	swap.c
10	thread.c
11	)
12
13if(CONFIG_ARCH_POSIX_TRAP_ON_FATAL)
14  if(CONFIG_NATIVE_LIBRARY)
15    target_sources(native_simulator INTERFACE fatal_trap.c)
16  else()
17    zephyr_library_sources(fatal_trap.c)
18  endif()
19endif()
20
21if(CONFIG_NATIVE_APPLICATION)
22	zephyr_include_directories(
23		nsi_compat/
24		${ZEPHYR_BASE}/scripts/native_simulator/common/src/include/
25	)
26	zephyr_library_sources(
27		posix_core_nsi.c
28		nsi_compat/nsi_compat.c
29		${ZEPHYR_BASE}/scripts/native_simulator/common/src/nct.c
30		${ZEPHYR_BASE}/scripts/native_simulator/common/src/nce.c
31		${ZEPHYR_BASE}/scripts/native_simulator/common/src/nsi_host_trampolines.c
32	)
33
34	zephyr_library_compile_definitions(_POSIX_C_SOURCE=200809L _XOPEN_SOURCE=600 _XOPEN_SOURCE_EXTENDED)
35else()
36	zephyr_library_sources(
37		posix_core_nsi.c
38	)
39endif()
40