From c1bcfbe826aa5241e5827e503f25871de8bdcff3 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Sun, 4 Aug 2024 13:08:23 +0900 Subject: [PATCH] CMakelists: Support HWMv2 structure 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 --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c185b827..9d50d173 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()