build: drop LEGACY_INCLUDE_PATH support
LEGACY_INCLUDE_PATH has been defaulting to "n" and marked as deprecated in both v3.2 and v3.3. Drop the option entirely for v3.4. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
parent
f874ba2746
commit
9b30667c77
|
@ -104,10 +104,6 @@ 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
|
||||
${PROJECT_BINARY_DIR}/include/generated
|
||||
|
|
|
@ -932,14 +932,3 @@ config COMPAT_INCLUDES
|
|||
deprecated header files.
|
||||
|
||||
endmenu
|
||||
|
||||
config LEGACY_INCLUDE_PATH
|
||||
bool "Allow for the legacy include paths (without the zephyr/ prefix) (DEPRECATED)"
|
||||
select DEPRECATED
|
||||
help
|
||||
DEPRECATED: Allow applications and libraries to use the Zephyr legacy
|
||||
include path which does not use the zephyr/ prefix. For example, the
|
||||
preferred way to include a Zephyr header is to use <zephyr/kernel.h>,
|
||||
but enabling CONFIG_LEGACY_INCLUDE_PATH will allow developers to use
|
||||
<kernel.h> instead. This (without the zephyr/ prefix) is deprecated
|
||||
and should be avoided. Eventually, it will not be supported.
|
||||
|
|
|
@ -5,7 +5,6 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
|||
-c ${CMAKE_C_COMPILER}
|
||||
-o ${CMAKE_OBJCOPY}
|
||||
-i ${ZEPHYR_BASE}/include
|
||||
$<$<BOOL:${CONFIG_LEGACY_INCLUDE_PATH}>:${ZEPHYR_BASE}/include/zephyr>
|
||||
-f ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.elf
|
||||
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
|
|
|
@ -3,7 +3,6 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
|||
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/arch/x86/zefi/zefi.py
|
||||
-c ${CMAKE_C_COMPILER}
|
||||
-i ${ZEPHYR_BASE}/include
|
||||
$<$<BOOL:${CONFIG_LEGACY_INCLUDE_PATH}>:${ZEPHYR_BASE}/include/zephyr>
|
||||
-o ${CMAKE_OBJCOPY}
|
||||
-f ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.elf
|
||||
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
|
||||
|
|
|
@ -5,7 +5,6 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
|||
-c ${CMAKE_C_COMPILER}
|
||||
-o ${CMAKE_OBJCOPY}
|
||||
-i ${ZEPHYR_BASE}/include
|
||||
$<$<BOOL:${CONFIG_LEGACY_INCLUDE_PATH}>:${ZEPHYR_BASE}/include/zephyr>
|
||||
-f ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.elf
|
||||
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
|
|
|
@ -5,7 +5,6 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
|||
-c ${CMAKE_C_COMPILER}
|
||||
-o ${CMAKE_OBJCOPY}
|
||||
-i ${ZEPHYR_BASE}/include
|
||||
$<$<BOOL:${CONFIG_LEGACY_INCLUDE_PATH}>:${ZEPHYR_BASE}/include/zephyr>
|
||||
-f ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.elf
|
||||
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
|
||||
#include <zephyr/kernel.h>
|
||||
|
||||
#ifndef CONFIG_LEGACY_INCLUDE_PATH
|
||||
#warning "<zephyr/zephyr.h> is deprecated, include <zephyr/kernel.h> instead"
|
||||
#endif
|
||||
|
||||
#endif /* ZEPHYR_INCLUDE_ZEPHYR_H_ */
|
||||
|
|
|
@ -36,7 +36,6 @@ if(CONFIG_HAS_RPI_PICO)
|
|||
-DZEPHYR_BASE=${ZEPHYR_BASE}
|
||||
-DFLASH_TYPE=${flash_type}
|
||||
-DPYTHON_EXECUTABLE=${Python3_EXECUTABLE}
|
||||
-DCONFIG_LEGACY_INCLUDE_PATH=$<BOOL:${CONFIG_LEGACY_INCLUDE_PATH}>
|
||||
-DRP2_BOOTLOADER_BYPRODUCT=${rp2_bootloader_asm}
|
||||
INSTALL_COMMAND "" # No installation needed
|
||||
BUILD_BYPRODUCTS ${rp2_bootloader_asm}
|
||||
|
|
|
@ -40,10 +40,6 @@ target_include_directories(boot_stage2 PUBLIC
|
|||
${ZEPHYR_BASE}/include
|
||||
)
|
||||
|
||||
if(CONFIG_LEGACY_INCLUDE_PATH)
|
||||
target_include_directories(boot_stage2 PUBLIC ${ZEPHYR_BASE}/include/zephyr)
|
||||
endif()
|
||||
|
||||
target_link_options(boot_stage2 PRIVATE
|
||||
"-nostartfiles"
|
||||
"--specs=nosys.specs"
|
||||
|
|
|
@ -1,85 +0,0 @@
|
|||
"""
|
||||
Utility script to migrate Zephyr-based projects to the new <zephyr/...> include
|
||||
prefix.
|
||||
|
||||
.. note::
|
||||
The script will also migrate <zephyr.h> or <zephyr/zephyr.h> to
|
||||
<zephyr/kernel.h>.
|
||||
|
||||
Usage::
|
||||
|
||||
python $ZEPHYR_BASE/scripts/utils/migrate_includes.py \
|
||||
-p path/to/zephyr-based-project
|
||||
|
||||
Copyright (c) 2022 Nordic Semiconductor ASA
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
"""
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
||||
ZEPHYR_BASE = Path(__file__).parents[2]
|
||||
|
||||
EXTENSIONS = ("c", "cpp", "h", "hpp", "dts", "dtsi", "rst", "S", "overlay", "ld")
|
||||
|
||||
|
||||
def update_includes(project, dry_run):
|
||||
for p in project.glob("**/*"):
|
||||
if not p.is_file() or not p.suffix or p.suffix[1:] not in EXTENSIONS:
|
||||
continue
|
||||
|
||||
try:
|
||||
with open(p) as f:
|
||||
lines = f.readlines()
|
||||
except UnicodeDecodeError:
|
||||
print(f"File with invalid encoding: {p}, skipping", file=sys.stderr)
|
||||
continue
|
||||
|
||||
content = ""
|
||||
migrate = False
|
||||
for line in lines:
|
||||
m = re.match(r"^(.*)#include <(.*\.h)>(.*)$", line)
|
||||
if m and m.group(2) in ("zephyr.h", "zephyr/zephyr.h"):
|
||||
content += (
|
||||
m.group(1)
|
||||
+ "#include <zephyr/kernel.h>"
|
||||
+ m.group(3)
|
||||
+ "\n"
|
||||
)
|
||||
migrate = True
|
||||
elif (
|
||||
m
|
||||
and not m.group(2).startswith("zephyr/")
|
||||
and (ZEPHYR_BASE / "include" / "zephyr" / m.group(2)).exists()
|
||||
):
|
||||
content += (
|
||||
m.group(1)
|
||||
+ "#include <zephyr/"
|
||||
+ m.group(2)
|
||||
+ ">"
|
||||
+ m.group(3)
|
||||
+ "\n"
|
||||
)
|
||||
migrate = True
|
||||
else:
|
||||
content += line
|
||||
|
||||
if migrate:
|
||||
print(f"Updating {p}{' (dry run)' if dry_run else ''}")
|
||||
if not dry_run:
|
||||
with open(p, "w") as f:
|
||||
f.write(content)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(allow_abbrev=False)
|
||||
parser.add_argument(
|
||||
"-p", "--project", type=Path, required=True, help="Zephyr-based project path"
|
||||
)
|
||||
parser.add_argument("--dry-run", action="store_true", help="Dry run")
|
||||
args = parser.parse_args()
|
||||
|
||||
update_includes(args.project, args.dry_run)
|
|
@ -4,8 +4,6 @@ add_subdirectory_ifdef(CONFIG_ZTEST ztest)
|
|||
|
||||
if(CONFIG_TEST)
|
||||
zephyr_include_directories(${ZEPHYR_BASE}/subsys/testsuite/include)
|
||||
zephyr_include_directories_ifdef(
|
||||
CONFIG_LEGACY_INCLUDE_PATH ${ZEPHYR_BASE}/subsys/testsuite/include/zephyr)
|
||||
endif()
|
||||
add_subdirectory_ifdef(CONFIG_COVERAGE_GCOV coverage)
|
||||
|
||||
|
|
|
@ -4,10 +4,6 @@ zephyr_include_directories(
|
|||
${ZEPHYR_BASE}/subsys/testsuite/include
|
||||
${ZEPHYR_BASE}/subsys/testsuite/ztest/include
|
||||
)
|
||||
zephyr_include_directories_ifdef(
|
||||
CONFIG_LEGACY_INCLUDE_PATH ${ZEPHYR_BASE}/subsys/testsuite/include/zephyr)
|
||||
zephyr_include_directories_ifdef(
|
||||
CONFIG_LEGACY_INCLUDE_PATH ${ZEPHYR_BASE}/subsys/testsuite/ztest/include/zephyr)
|
||||
|
||||
if(DEFINED TC_RUNID)
|
||||
zephyr_compile_definitions(TC_RUNID=${TC_RUNID})
|
||||
|
|
Loading…
Reference in a new issue