File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,15 @@ macro(is_zephyr ret)
4949 endif ()
5050endmacro ()
5151
52+ # This macro
53+ # - saves a LOT of repetition, and
54+ # - mimics Zephyr, which helps with compatibility.
55+ macro (add_local_sources_ifdef condition target )
56+ if (${condition} )
57+ add_local_sources(${target} ${ARGN} )
58+ endif ()
59+ endmacro ()
60+
5261# Adds sources to target like target_sources, but assumes that
5362# paths are relative to subdirectory.
5463# Works like:
Original file line number Diff line number Diff line change @@ -128,6 +128,22 @@ macro(is_zephyr ret)
128128 endif ()
129129endmacro ()
130130
131+ # Wrappers for compatibility and re-use of existing, XTOS CMake files.
132+ # Do NOT use these macros in this file or in any other Zephyr-specific
133+ # CMake code.
134+ macro (add_local_sources target )
135+ if (NOT "${target} " STREQUAL "sof" )
136+ message (FATAL_ERROR "add_local_sources() target is not 'sof'" )
137+ endif ()
138+ zephyr_library_sources(${ARGN} )
139+ endmacro ()
140+ macro (add_local_sources_ifdef condition target )
141+ if (NOT "${target} " STREQUAL "sof" )
142+ message (FATAL_ERROR "add_local_sources_ifdef() target is not 'sof'" )
143+ endif ()
144+ zephyr_library_sources_ifdef(${condition} ${ARGN} )
145+ endmacro ()
146+
131147add_subdirectory (../src/init/ init_unused_install/)
132148add_subdirectory (../src/ipc/ ipc_unused_install/)
133149
You can’t perform that action at this time.
0 commit comments