build: make non zephyr/ include prefix configurable

Add a Kconfig to disable non prefixed includes. By setting
`CONFIG_LEGACY_INCLUDE_PATH=n` developers can disable having
`include/zephyr` in the search path. This means that includes such
as `#include <kernel.h>` will no longer work.

Internally, every header should be updated to add the `zephyr/`
prefix to the headers. Only then, will developers be able to use
this config value for their applications.

Signed-off-by: Yuval Peress <peress@google.com>
This commit is contained in:
Yuval Peress 2022-03-31 21:05:42 -06:00 committed by Carles Cufí
commit 1ec0c6f530
9 changed files with 30 additions and 8 deletions

View file

@ -104,9 +104,12 @@ add_library(zephyr_interface INTERFACE)
# flags that come with zephyr_interface.
zephyr_library_named(zephyr)
if(CONFIG_LEGACY_INCLUDE_PATH)
zephyr_include_directories(include/zephyr)
endif()
zephyr_include_directories(
include
include/zephyr
${PROJECT_BINARY_DIR}/include/generated
${USERINCLUDE}
${STDINCLUDE}