Skip to content

Commit

Permalink
CMakelists: Support HWMv2 structure
Browse files Browse the repository at this point in the history
Change the criteria so that not only `variants/${BOARD}` but also
`variants/${BOARD}${BOARD_QUALIFIERS}` are valid as variant paths.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
  • Loading branch information
soburi authored and DhruvaG2000 committed Aug 18, 2024
1 parent 3538c54 commit c1bcfbe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# SPDX-License-Identifier: Apache-2.0

if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/variants/${BOARD})
set(variant_dir variants/${BOARD})
elseif (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/variants/${BOARD}${NORMALIZED_BOARD_QUALIFIERS})
set(variant_dir variants/${BOARD}${NORMALIZED_BOARD_QUALIFIERS})
else()
message(FATAL_ERROR "Variant dir not found: variants/${BOARD}, variants/${BOARD}${NORMALIZED_BOARD_QUALIFIERS}")
endif()

if (CONFIG_ARDUINO_API)
add_subdirectory(cores)
add_subdirectory(libraries)
zephyr_include_directories(variants/${BOARD})
zephyr_include_directories(${variant_dir})
endif()

0 comments on commit c1bcfbe

Please sign in to comment.