From 419f008f2390b9a6d0f047733378059adb6adbb1 Mon Sep 17 00:00:00 2001 From: Yong Cong Sin Date: Wed, 8 Nov 2023 18:05:43 +0800 Subject: [PATCH] build: namespace the generated headers with `zephyr/`` Zephyr's build time generated headers are now in the `zephyr` to provide proper namespace, update the path accordingly. See ZephyrProject upstream PR at: zephyrproject-rtos/zephyr#63973 Signed-off-by: Yong Cong Sin --- app/Kconfig | 19 +++++++++++++++++++ app/prj.conf | 3 +++ src/init/init.c | 4 ++++ src/ipc/ipc-zephyr.c | 2 +- src/trace/dma-trace.c | 4 ++++ zephyr/lib/alloc.c | 4 ++++ zephyr/lib/cpu.c | 4 ++++ zephyr/wrapper.c | 4 ++++ 8 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 app/Kconfig diff --git a/app/Kconfig b/app/Kconfig new file mode 100644 index 000000000000..298383f79e5a --- /dev/null +++ b/app/Kconfig @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2023 Meta +# +# Author: Yong Cong Sin + +menu "Compatibility" + +config SOF_COMPAT_INCLUDES + bool "Use legacy include path" + default n + help + Use legacy Zephyr generated include paths, + i.e. `#include instead of: + `#include ` + +endmenu + +source "Kconfig" diff --git a/app/prj.conf b/app/prj.conf index 5a681ac5b74b..c0d00b0ffb73 100644 --- a/app/prj.conf +++ b/app/prj.conf @@ -57,3 +57,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=2048 CONFIG_LLEXT=y CONFIG_LLEXT_STORAGE_WRITABLE=y CONFIG_MODULES=y + +# To be able to use Zephyr legacy include paths +CONFIG_SOF_COMPAT_INCLUDES=y diff --git a/src/init/init.c b/src/init/init.c index e6a68dcc7f0f..52cc8627b678 100644 --- a/src/init/init.c +++ b/src/init/init.c @@ -40,7 +40,11 @@ #include #include #include +#ifdef CONFIG_SOF_COMPAT_INCLUDES #include +#else +#include +#endif #endif #include diff --git a/src/ipc/ipc-zephyr.c b/src/ipc/ipc-zephyr.c index 49a448850a99..aa46baec36f3 100644 --- a/src/ipc/ipc-zephyr.c +++ b/src/ipc/ipc-zephyr.c @@ -9,7 +9,7 @@ // Andrey Borisovich // Adrian Warecki -#include +#include #include #include diff --git a/src/trace/dma-trace.c b/src/trace/dma-trace.c index 5ef24dd8501b..411f28ac37bd 100644 --- a/src/trace/dma-trace.c +++ b/src/trace/dma-trace.c @@ -30,7 +30,11 @@ #include #ifdef __ZEPHYR__ +#ifdef CONFIG_SOF_COMPAT_INCLUDES #include +#else +#include +#endif #endif #include diff --git a/zephyr/lib/alloc.c b/zephyr/lib/alloc.c index c931eeb5658a..c67528b6506b 100644 --- a/zephyr/lib/alloc.c +++ b/zephyr/lib/alloc.c @@ -23,7 +23,11 @@ #include #include #include +#ifdef CONFIG_SOF_COMPAT_INCLUDES #include +#else +#include +#endif #include #include diff --git a/zephyr/lib/cpu.c b/zephyr/lib/cpu.c index e65c85729c13..391ba6d9bd08 100644 --- a/zephyr/lib/cpu.c +++ b/zephyr/lib/cpu.c @@ -17,7 +17,11 @@ #include /* Zephyr includes */ +#ifdef CONFIG_SOF_COMPAT_INCLUDES #include +#else +#include +#endif #include #include #include diff --git a/zephyr/wrapper.c b/zephyr/wrapper.c index 89c130c6a12d..89119b4d6e56 100644 --- a/zephyr/wrapper.c +++ b/zephyr/wrapper.c @@ -28,7 +28,11 @@ #include #include #include +#ifdef CONFIG_SOF_COMPAT_INCLUDES #include +#else +#include +#endif #include #include #include