From cb18cae727f82430553297de46802d720c04aae4 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Sat, 1 Nov 2025 16:37:44 +0900 Subject: [PATCH 1/2] CMakeLists.txt: Match variants by canonical board name Uses the HWMv2 canonical board name to determine paths under variants. Signed-off-by: TOKITA Hiroshi --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d50d173b..2f1955936 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,9 @@ # 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}) +if (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}") + message(FATAL_ERROR "Variant dir not found: variants/${BOARD}${NORMALIZED_BOARD_QUALIFIERS}") endif() if (CONFIG_ARDUINO_API) From 2230a41370c9146bf66198e3b2484c05fc3955c3 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Sat, 1 Nov 2025 12:39:38 +0900 Subject: [PATCH 2/2] CMakeLists.txt: Do nothing when the CONFIG_ARDUINO_API is disabled. Disables processing when CONFIG_ARDUINO_API is disabled so that checking the existence of variants does not work when this API is not used. Signed-off-by: TOKITA Hiroshi --- CMakeLists.txt | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f1955936..484c3721d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,13 @@ # SPDX-License-Identifier: Apache-2.0 -if (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}${NORMALIZED_BOARD_QUALIFIERS}") -endif() - if (CONFIG_ARDUINO_API) -add_subdirectory(cores) -add_subdirectory(libraries) -zephyr_include_directories(${variant_dir}) -endif() + if (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}${NORMALIZED_BOARD_QUALIFIERS}") + endif() + add_subdirectory(cores) + add_subdirectory(libraries) + zephyr_include_directories(${variant_dir}) +endif()