Skip to content

Commit b7b9d15

Browse files
committed
build: remove XTOS-specific sections from cmake lists
The "is_zephyr()" macro is used to fork sections of cmake lists for Zephyr and other builds. Remove XTOS-specific sections but keep non-Zephyr host-based builds like testbench, plugin and cmocka. Also use a more logical "is_zephyr(zephyr)" form instead of the earlier "is_zephyr(it_is)." Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 9132233 commit b7b9d15

File tree

19 files changed

+33
-155
lines changed

19 files changed

+33
-155
lines changed

scripts/cmake/uuid-registry.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# Simple target. FOUR (really 4.5, as LIBRARY builds use the same
66
# CMakeLists.txt but differ significantly in how it executes)
77
# different cmake environments into which it needs to build.
8-
is_zephyr(zephyr_is)
9-
if(zephyr_is)
8+
is_zephyr(zephyr)
9+
if(zephyr)
1010
set(TOPDIR ${sof_top_dir})
1111
set(UUID_REG_H ${PROJECT_BINARY_DIR}/include/generated/uuid-registry.h)
1212
set(DEP_TARGET zephyr_interface)

src/audio/CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,17 @@ sof_list_append_ifdef(CONFIG_COMP_BLOB base_files data_blob.c)
131131

132132
### (end of common files)
133133

134-
is_zephyr(it_is)
135-
if(it_is) ### Zephyr ###
134+
is_zephyr(zephyr)
135+
if(zephyr) ### Zephyr ###
136136

137137
zephyr_library_sources(
138138
${base_files}
139139
)
140140

141141
return()
142-
endif()
143-
144-
### XTOS normal build (not shared library) ###
142+
elseif(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
143+
### not shared library, e.g. testbench ###
145144

146-
if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
147145
add_local_sources(sof
148146
host-legacy.c
149147
${base_files}

src/audio/codec/CMakeLists.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,3 @@ if(zephyr) ### Zephyr ###
1919

2020
return()
2121
endif()
22-
23-
### XTOS ###
24-
if(CONFIG_DTS_CODEC)
25-
add_local_sources(sof dts/dts.c)
26-
target_compile_definitions(sof PRIVATE -DDTS_MATH_INT32 -DDTS_XTENSA)
27-
28-
if (CONFIG_DTS_CODEC_STUB)
29-
add_local_sources(sof dts/dts_stub.c)
30-
else()
31-
sof_add_static_library(DtsCodec
32-
${SOF_ROOT_SOURCE_DIRECTORY}/third_party/lib/libdts-sof-interface-i32.a)
33-
target_include_directories(sof PRIVATE ${CMAKE_SOURCE_DIR}/third_party/include)
34-
endif()
35-
36-
endif()

src/audio/google/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ if(zephyr) ### Zephyr ###
6565
return()
6666
endif()
6767

68-
### XTOS build rules ###
69-
if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC)
68+
### Library build rules ###
69+
if(CONFIG_LIBRARY_STATIC)
7070
if(CONFIG_COMP_GOOGLE_HOTWORD_DETECT)
7171
add_local_sources(sof
7272
google_hotword_detect.c

src/audio/rtnr/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,11 @@ if(zephyr) ### Zephyr ###
1212
zephyr_library_sources(rtnr.c)
1313
zephyr_library_sources_ifdef(CONFIG_COMP_RTNR_STUB rtnr_stub.c)
1414

15-
else() ### XTOS ###
15+
else() ### library, e.g. testbench or plugin ###
1616

1717
add_local_sources(sof rtnr.c)
1818
if (CONFIG_COMP_RTNR_STUB)
1919
add_local_sources(sof rtnr_stub.c)
20-
elseif(CONFIG_TIGERLAKE)
21-
add_subdirectory(rtklib/tgl)
22-
elseif(CONFIG_MT8195)
23-
add_subdirectory(rtklib/mt8195)
2420
endif()
2521

2622
endif()

src/audio/smart_amp/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,4 @@ if(zephyr) ### Zephyr ###
2222
zephyr_include_directories(CONFIG_MAXIM_DSM ${CMAKE_CURRENT_LIST_DIR}/include/dsm_api/inc/)
2323
endif()
2424

25-
else() ### XTOS
26-
27-
if(CONFIG_MAXIM_DSM)
28-
if(NOT CONFIG_MAXIM_DSM_STUB)
29-
sof_add_static_library(dsm ${CMAKE_CURRENT_LIST_DIR}/lib/release/dsm_lib/libdsm.a)
30-
endif()
31-
32-
target_include_directories(sof PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include/dsm_api/inc)
33-
endif()
34-
3525
endif()

src/audio/src/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ endif()
1010

1111
sof_list_append_ifdef(CONFIG_COMP_SRC_LITE base_files src_lite.c)
1212

13-
is_zephyr(it_is)
14-
if(it_is) ### Zephyr ###
13+
is_zephyr(zephyr)
14+
if(zephyr) ### Zephyr ###
1515

1616
if(CONFIG_COMP_SRC STREQUAL "m")
1717

@@ -24,8 +24,4 @@ if(it_is) ### Zephyr ###
2424

2525
endif()
2626

27-
else() ### XTOS ###
28-
29-
add_local_sources(sof ${base_files})
30-
3127
endif()

src/debug/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,12 @@ endif()
66

77
add_subdirectory(tester)
88

9-
is_zephyr(it_is)
10-
if(it_is) ### Zephyr ###
9+
is_zephyr(zephyr)
10+
if(zephyr) ### Zephyr ###
1111

1212
add_subdirectory(debug_stream)
1313
add_subdirectory(telemetry)
1414

1515
zephyr_library_sources_ifdef(CONFIG_COLD_STORE_EXECUTE_DEBUG dram.c)
1616

17-
else() ### Not Zephyr ###
18-
19-
add_local_sources(sof panic.c)
20-
2117
endif() # Zephyr

src/debug/tester/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ set(base_files
66
tester_simple_dram_test.c
77
)
88

9-
is_zephyr(it_is)
10-
if(it_is) ### Zephyr ###
9+
is_zephyr(zephyr)
10+
if(zephyr) ### Zephyr ###
1111

1212
if(CONFIG_COMP_TESTER STREQUAL "m")
1313

@@ -20,10 +20,4 @@ if(it_is) ### Zephyr ###
2020

2121
endif()
2222

23-
else() ### XTOS ###
24-
25-
if(CONFIG_COMP_TESTER)
26-
add_local_sources(sof ${base_files})
27-
endif()
28-
2923
endif()

src/idc/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ is_zephyr(zephyr)
44
if(zephyr)
55
add_local_sources_ifdef(CONFIG_SMP sof idc.c)
66
add_local_sources(sof zephyr_idc.c)
7-
else()
8-
add_local_sources(sof idc.c)
97
endif()

0 commit comments

Comments
 (0)