zephyr/boards/CMakeLists.txt
Grant Ramsay 4a21035aa5 boards: shields: Allow adding source code to shields
Add shield CMakeLists.txt if it exists.
Useful for one-off shields that require C code

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2024-08-01 08:57:33 +01:00

21 lines
590 B
CMake

# SPDX-License-Identifier: Apache-2.0
# To avoid a lot of empty CMakeLists.txt files we assume it is not an
# error if it is missing
if(EXISTS ${BOARD_DIR}/CMakeLists.txt)
if(USING_OUT_OF_TREE_BOARD)
set(build_dir boards/${ARCH}/${BOARD})
else()
unset(build_dir)
# FIXME: SHADOW_VARS: Remove this once we have enabled -Wshadow globally.
#
# For now, only enable warning for shadow variables for in-tree boards.
add_compile_options($<TARGET_PROPERTY:compiler,warning_shadow_variables>)
endif()
add_subdirectory(${BOARD_DIR} ${build_dir})
endif()
add_subdirectory(shields)