diff --git a/lib/posix/options/CMakeLists.txt b/lib/posix/options/CMakeLists.txt index 58f44773e31b9..59fd8c99d67ef 100644 --- a/lib/posix/options/CMakeLists.txt +++ b/lib/posix/options/CMakeLists.txt @@ -4,7 +4,7 @@ set(GEN_DIR ${ZEPHYR_BINARY_DIR}/include/generated) zephyr_syscall_header_ifdef(CONFIG_POSIX_TIMERS posix_clock.h) -if(CONFIG_POSIX_API) +if(CONFIG_POSIX_HEADERS_IN_DEFAULT_SEARCH_PATH) zephyr_include_directories(${ZEPHYR_BASE}/include/zephyr/posix) endif() diff --git a/lib/posix/options/Kconfig b/lib/posix/options/Kconfig index 6c2b129170e30..abaa42b62b658 100644 --- a/lib/posix/options/Kconfig +++ b/lib/posix/options/Kconfig @@ -6,6 +6,8 @@ menu "POSIX Options" +rsource "Kconfig.build" + rsource "Kconfig.profile" rsource "Kconfig.aio" diff --git a/lib/posix/options/Kconfig.build b/lib/posix/options/Kconfig.build new file mode 100644 index 0000000000000..61f15d0448554 --- /dev/null +++ b/lib/posix/options/Kconfig.build @@ -0,0 +1,12 @@ +# Copyright (c) 2025 Tenstorrent AI ULC +# +# SPDX-License-Identifier: Apache-2.0 + +menu "POSIX build options" + +config POSIX_HEADERS_IN_DEFAULT_SEARCH_PATH + bool "POSIX headers in default search path" + help + Select 'y' here and Zephyr's POSIX headers will be included in the default search path. + +endmenu diff --git a/lib/posix/options/Kconfig.profile b/lib/posix/options/Kconfig.profile index 4f97786b0d577..f19aee10998b2 100644 --- a/lib/posix/options/Kconfig.profile +++ b/lib/posix/options/Kconfig.profile @@ -9,6 +9,7 @@ config POSIX_API select POSIX_BASE_DEFINITIONS # clock_gettime(), pthread_create(), sem_get(), etc select POSIX_AEP_REALTIME_MINIMAL # CLOCK_MONOTONIC, pthread_attr_setstack(), etc select POSIX_NETWORKING if NETWORKING # inet_ntoa(), socket(), etc + select POSIX_HEADERS_IN_DEFAULT_SEARCH_PATH imply EVENTFD # eventfd(), eventfd_read(), eventfd_write() imply POSIX_FD_MGMT # open(), close(), read(), write() imply POSIX_MESSAGE_PASSING # mq_open(), etc