File tree Expand file tree Collapse file tree 9 files changed +30
-8
lines changed Expand file tree Collapse file tree 9 files changed +30
-8
lines changed Original file line number Diff line number Diff line change @@ -104,9 +104,12 @@ add_library(zephyr_interface INTERFACE)
104104# flags that come with zephyr_interface.
105105zephyr_library_named(zephyr)
106106
107+ if (CONFIG_LEGACY_INCLUDE_PATH)
108+ zephyr_include_directories(include /zephyr)
109+ endif ()
110+
107111zephyr_include_directories(
108112 include
109- include /zephyr
110113 ${PROJECT_BINARY_DIR} /include /generated
111114 ${USERINCLUDE}
112115 ${STDINCLUDE}
Original file line number Diff line number Diff line change @@ -800,3 +800,15 @@ config COMPAT_INCLUDES
800800 deprecated header files.
801801
802802endmenu
803+
804+ config LEGACY_INCLUDE_PATH
805+ bool "Allow for the legacy include paths (without the zephyr/ prefix)"
806+ default y
807+ help
808+ Allow applications and libraries to use the Zephyr legacy include
809+ path which does not use the zephyr/ prefix. For example, the
810+ preferred way to include a Zephyr header is to use <zephyr/kernel.h>,
811+ but enabling CONFIG_LEGACY_INCLUDE_PATH will allow developers to
812+ use <kernel.h> instead. This (without the zephyr/ prefix) is
813+ deprecated and should be avoided. Eventually, it will not be
814+ supported.
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
55 -c ${CMAKE_C_COMPILER}
66 -o ${CMAKE_OBJCOPY}
77 -i ${ZEPHYR_BASE} /include
8- -i ${ZEPHYR_BASE} /include /zephyr
8+ $<$<BOOL :${CONFIG_LEGACY_INCLUDE_PATH} >:-i>
9+ $<$<BOOL :${CONFIG_LEGACY_INCLUDE_PATH} >:${ZEPHYR_BASE} /include /zephyr>
910 -f ${PROJECT_BINARY_DIR} /${CONFIG_KERNEL_BIN_NAME} .elf
1011 $<$<BOOL :${CMAKE_VERBOSE_MAKEFILE} >:--verbose>
1112 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
33 COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR} /arch/x86/zefi/zefi.py
44 -c ${CMAKE_C_COMPILER}
55 -i ${ZEPHYR_BASE} /include
6- -i ${ZEPHYR_BASE} /include /zephyr
6+ $<$<BOOL :${CONFIG_LEGACY_INCLUDE_PATH} >:-i>
7+ $<$<BOOL :${CONFIG_LEGACY_INCLUDE_PATH} >:${ZEPHYR_BASE} /include /zephyr>
78 -o ${CMAKE_OBJCOPY}
89 -f ${PROJECT_BINARY_DIR} /${CONFIG_KERNEL_BIN_NAME} .elf
910 $<$<BOOL :${CMAKE_VERBOSE_MAKEFILE} >:--verbose>
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
55 -c ${CMAKE_C_COMPILER}
66 -o ${CMAKE_OBJCOPY}
77 -i ${ZEPHYR_BASE} /include
8- -i ${ZEPHYR_BASE} /include /zephyr
8+ $<$<BOOL :${CONFIG_LEGACY_INCLUDE_PATH} >:-i>
9+ $<$<BOOL :${CONFIG_LEGACY_INCLUDE_PATH} >:${ZEPHYR_BASE} /include /zephyr>
910 -f ${PROJECT_BINARY_DIR} /${CONFIG_KERNEL_BIN_NAME} .elf
1011 $<$<BOOL :${CMAKE_VERBOSE_MAKEFILE} >:--verbose>
1112 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ gen_kobj(KOBJ_GEN_DIR)
3434list (APPEND INCLUDE
3535 subsys/testsuite/ztest/include
3636 subsys/testsuite/include
37- include
3837 include /zephyr
38+ include
3939 .
4040)
4141
Original file line number Diff line number Diff line change @@ -928,8 +928,8 @@ RECURSIVE = YES
928928# Note that relative paths are relative to the directory from which doxygen is
929929# run.
930930
931- EXCLUDE = @ZEPHYR_BASE@/include/portability/cmsis_os.h \
932- @ZEPHYR_BASE@/include/portability/cmsis_os2.h
931+ EXCLUDE = @ZEPHYR_BASE@/include/zephyr/ portability/cmsis_os.h \
932+ @ZEPHYR_BASE@/include/zephyr/ portability/cmsis_os2.h
933933
934934# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
935935# directories that are symbolic links (a Unix file system feature) are excluded
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ if(CONFIG_HAS_RPI_PICO)
3333 -DZEPHYR_BASE=${ZEPHYR_BASE}
3434 -DFLASH_TYPE=${flash_type}
3535 -DPYTHON_EXECUTABLE=${Python3_EXECUTABLE}
36+ -DCONFIG_LEGACY_INCLUDE_PATH=$<BOOL :${CONFIG_LEGACY_INCLUDE_PATH} >
3637 INSTALL_COMMAND "" # No installation needed
3738 BUILD_BYPRODUCTS ${rp2_bootloader_prefix} /boot_stage2.S
3839 BUILD_ALWAYS TRUE
Original file line number Diff line number Diff line change @@ -38,9 +38,12 @@ target_include_directories(boot_stage2 PUBLIC
3838 ${rp2040_dir} /hardware_regs/include
3939 ${common_dir} /pico_base/include
4040 ${ZEPHYR_BASE} /include
41- ${ZEPHYR_BASE} /include /zephyr
4241 )
4342
43+ if (CONFIG_LEGACY_INCLUDE_PATH)
44+ target_include_directories (boot_stage2 PUBLIC ${ZEPHYR_BASE} /include /zephyr)
45+ endif ()
46+
4447target_link_options (boot_stage2 PRIVATE
4548 "-nostartfiles"
4649 "--specs=nosys.specs"
You can’t perform that action at this time.
0 commit comments