mirror of https://github.com/thesofproject/sof.git
cmake: a few new add_local_sources[_ifdef]() compatibility macros
For reducing CMake duplication and centralization, see #8260 Not used yet. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
parent
98d5efc3a7
commit
330d73eec1
|
@ -49,6 +49,15 @@ macro(is_zephyr ret)
|
|||
endif()
|
||||
endmacro()
|
||||
|
||||
# This macro
|
||||
# - saves a LOT of repetition, and
|
||||
# - mimics Zephyr, which helps with compatibility.
|
||||
macro(add_local_sources_ifdef condition target)
|
||||
if(${condition})
|
||||
add_local_sources(${target} ${ARGN})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Adds sources to target like target_sources, but assumes that
|
||||
# paths are relative to subdirectory.
|
||||
# Works like:
|
||||
|
|
|
@ -128,6 +128,22 @@ macro(is_zephyr ret)
|
|||
endif()
|
||||
endmacro()
|
||||
|
||||
# Wrappers for compatibility and re-use of existing, XTOS CMake files.
|
||||
# Do NOT use these macros in this file or in any other Zephyr-specific
|
||||
# CMake code.
|
||||
macro(add_local_sources target)
|
||||
if (NOT "${target}" STREQUAL "sof")
|
||||
message(FATAL_ERROR "add_local_sources() target is not 'sof'")
|
||||
endif()
|
||||
zephyr_library_sources(${ARGN})
|
||||
endmacro()
|
||||
macro(add_local_sources_ifdef condition target)
|
||||
if (NOT "${target}" STREQUAL "sof")
|
||||
message(FATAL_ERROR "add_local_sources_ifdef() target is not 'sof'")
|
||||
endif()
|
||||
zephyr_library_sources_ifdef(${condition} ${ARGN})
|
||||
endmacro()
|
||||
|
||||
add_subdirectory(../src/init/ init_unused_install/)
|
||||
add_subdirectory(../src/ipc/ ipc_unused_install/)
|
||||
|
||||
|
|
Loading…
Reference in New Issue