Skip to content

Commit d687e96

Browse files
committed
zephyr: namespace the generated version.h
Zephyr's build time generated `version.h` is now in the `zephyr` to provide proper namespace, update the includes of this module accordingly. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
1 parent 49377e8 commit d687e96

File tree

7 files changed

+37
-0
lines changed

7 files changed

+37
-0
lines changed

app/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright(c) 2023 Meta
3+
4+
menu "Compatibility"
5+
6+
config SOF_COMPAT_INCLUDES
7+
bool "Use legacy include path"
8+
default n
9+
help
10+
Use legacy Zephyr include paths.
11+
12+
endmenu
13+
14+
source "Kconfig"

app/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ CONFIG_SCHED_CPU_MASK_PIN_ONLY=y
5656
CONFIG_SYS_CLOCK_TICKS_PER_SEC=15000
5757
CONFIG_DAI=y
5858
CONFIG_HEAP_MEM_POOL_SIZE=2048
59+
60+
# To be able to use Zephyr legacy include paths
61+
CONFIG_SOF_COMPAT_INCLUDES=y

src/init/init.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@
3838
#include <zephyr/logging/log_ctrl.h>
3939
#include <user/abi_dbg.h>
4040
#include <sof_versions.h>
41+
#ifdef CONFIG_SOF_COMPAT_INCLUDES
4142
#include <version.h>
43+
#else
44+
#include <zephyr/version.h>
45+
#endif
4246
#endif
4347
#include <sof/lib/ams.h>
4448

src/trace/dma-trace.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
#include <sof_versions.h>
3030

3131
#ifdef __ZEPHYR__
32+
#ifdef CONFIG_SOF_COMPAT_INCLUDES
3233
#include <version.h>
34+
#else
35+
#include <zephyr/version.h>
36+
#endif
3337
#endif
3438

3539
#include <errno.h>

zephyr/lib/alloc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
#include <zephyr/init.h>
2424
#include <zephyr/kernel.h>
2525
#include <zephyr/pm/policy.h>
26+
#ifdef CONFIG_SOF_COMPAT_INCLUDES
2627
#include <version.h>
28+
#else
29+
#include <zephyr/version.h>
30+
#endif
2731
#include <zephyr/sys/__assert.h>
2832
#include <zephyr/cache.h>
2933

zephyr/lib/cpu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
#include <rtos/alloc.h>
1818

1919
/* Zephyr includes */
20+
#ifdef CONFIG_SOF_COMPAT_INCLUDES
2021
#include <version.h>
22+
#else
23+
#include <zephyr/version.h>
24+
#endif
2125
#include <zephyr/kernel.h>
2226
#include <zephyr/device.h>
2327
#include <zephyr/drivers/mm/mm_drv_intel_adsp_mtl_tlb.h>

zephyr/wrapper.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
#include <zephyr/kernel_structs.h>
3030
#include <zephyr/kernel.h>
3131
#include <zephyr/pm/policy.h>
32+
#ifdef CONFIG_SOF_COMPAT_INCLUDES
3233
#include <version.h>
34+
#else
35+
#include <zephyr/version.h>
36+
#endif
3337
#include <zephyr/sys/__assert.h>
3438
#include <zephyr/logging/log_ctrl.h>
3539
#include <zephyr/logging/log.h>

0 commit comments

Comments
 (0)