File tree 3 files changed +20
-8
lines changed
3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 2
2
3
3
if (NOT CONFIG_NATIVE_APPLICATION)
4
4
add_subdirectory (libc)
5
+ add_subdirectory (posix)
5
6
endif ()
6
- add_subdirectory_ifdef(CONFIG_POSIX_API posix)
7
7
add_subdirectory_ifdef(CONFIG_CMSIS_RTOS_V1 cmsis_rtos_v1)
8
8
add_subdirectory_ifdef(CONFIG_CMSIS_RTOS_V2 cmsis_rtos_v2)
9
9
add_subdirectory (gui)
Original file line number Diff line number Diff line change 3
3
4
4
zephyr_interface_library_named(posix_subsys)
5
5
6
- target_include_directories (posix_subsys INTERFACE ${ZEPHYR_BASE} /include /posix)
6
+ if (CONFIG_POSIX_API)
7
+ target_include_directories (posix_subsys INTERFACE ${ZEPHYR_BASE} /include /posix)
8
+ endif ()
7
9
8
10
zephyr_library()
9
11
zephyr_library_sources(pthread_common.c)
10
12
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC pthread_cond.c)
11
13
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC pthread_mutex.c)
12
14
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC pthread_barrier.c)
13
15
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC pthread.c)
14
- zephyr_library_sources( pthread_sched.c)
15
- zephyr_library_sources( clock.c)
16
- zephyr_library_sources( sleep.c)
17
- zephyr_library_sources( timer.c)
16
+ zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC pthread_sched.c)
17
+ zephyr_library_sources_ifdef(CONFIG_POSIX_CLOCK clock.c)
18
+ zephyr_library_sources_ifdef(CONFIG_POSIX_CLOCK sleep.c)
19
+ zephyr_library_sources_ifdef(CONFIG_POSIX_CLOCK timer.c)
18
20
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC pthread_rwlock.c)
19
21
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC semaphore.c)
20
22
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC pthread_key.c)
Original file line number Diff line number Diff line change @@ -19,10 +19,9 @@ config POSIX_API
19
19
Enable mostly-standards-compliant implementations of
20
20
various POSIX (IEEE 1003.1) APIs.
21
21
22
- if POSIX_API
23
-
24
22
config PTHREAD_IPC
25
23
bool "POSIX pthread IPC API"
24
+ default y if POSIX_API
26
25
help
27
26
This enables a mostly-standards-compliant implementation of
28
27
the pthread mutex, condition variable and barrier IPC
@@ -45,6 +44,13 @@ config SEM_VALUE_MAX
45
44
46
45
endif # PTHREAD_IPC
47
46
47
+ config POSIX_CLOCK
48
+ bool "POSIX clock, timer, and sleep APIs"
49
+ default y if POSIX_API
50
+ help
51
+ This enables POSIX clock\_\*(), timer\_\*(), and \*sleep()
52
+ functions.
53
+
48
54
config MAX_TIMER_COUNT
49
55
int "Maximum timer count in POSIX application"
50
56
default 5
@@ -54,6 +60,7 @@ config MAX_TIMER_COUNT
54
60
55
61
config POSIX_MQUEUE
56
62
bool "Enable POSIX message queue"
63
+ default y if POSIX_API
57
64
help
58
65
This enabled POSIX message queue related APIs.
59
66
83
90
if FILE_SYSTEM
84
91
config POSIX_FS
85
92
bool "Enable POSIX file system API support"
93
+ default y if POSIX_API
86
94
help
87
95
This enables POSIX style file system related APIs.
88
96
@@ -96,6 +104,8 @@ config POSIX_MAX_OPEN_FILES
96
104
endif
97
105
endif # FILE_SYSTEM
98
106
107
+ if POSIX_API
108
+
99
109
# The name of this option is mandated by zephyr_interface_library_named
100
110
# cmake directive.
101
111
config APP_LINK_WITH_POSIX_SUBSYS
You can’t perform that action at this time.
0 commit comments