posix: ensure that pooled ipc type is user-configurable

Previously it was not possible to n-select e.g.
CONFIG_PTHREAD_BARRIER because the Kconfig template for it
lacked a prompt. This made it impossible to disable some
unused POSIX features and unnecessarily increased code size
if unused code sections were not discarded by the linker.

Add a prompt so that each pooled IPC type is
user-configurable and can be disabled if unneeded.

Further, ensure that only the selected sources from lib/posix
are included in the cmake build.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
This commit is contained in:
Christopher Friedt 2023-10-13 08:18:02 -04:00 committed by Chris Friedt
parent d661c86e35
commit 7e8953ed7f
2 changed files with 8 additions and 8 deletions

View file

@ -48,15 +48,15 @@ zephyr_library_sources_ifdef(CONFIG_POSIX_MQUEUE mqueue.c)
zephyr_library_sources_ifdef(CONFIG_POSIX_SIGNAL signal.c ${STRSIGNAL_TABLE_H})
zephyr_library_sources_ifdef(CONFIG_POSIX_UNAME uname.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC _common.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC barrier.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC cond.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC key.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC mutex.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC pthread.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_BARRIER barrier.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_COND cond.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_KEY key.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_MUTEX mutex.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD pthread.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC rwlock.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC sched.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC semaphore.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC spinlock.c)
zephyr_library_sources_ifdef(CONFIG_PTHREAD_SPINLOCK spinlock.c)
zephyr_library_include_directories(
${ZEPHYR_BASE}/kernel/include

View file

@ -7,9 +7,9 @@ source "lib/posix/Kconfig.template.with_logging"
# Not user configurable (i.e. private for now)
config $(TYPE)
bool
default y
bool "POSIX $(type) support"
depends on PTHREAD_IPC
default y
help
Support for $(TYPE)
For more info, see