From 56a446b4ee04b3e8cb0a85f60e49a077a8801593 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Fri, 25 Jul 2025 11:08:02 +0100 Subject: [PATCH] modules: cmsis, cmsis_6: only add the intended cmsis module The current code base is meant to use cmsis for Cortex A and R and cmsis_6 for Cortex M, but the build system is configured to include the path for both when Cortex M is selected. This leaves us exposed to PR using the old headers, that would not get caught in CI but would fail the build on a project using Cortex M that only has the cmsis_6 module. Change the cmsis module setting to only include the module files in the intended case. Signed-off-by: Fabio Baltieri --- modules/cmsis/CMakeLists.txt | 3 +-- modules/cmsis_6/CMakeLists.txt | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/cmsis/CMakeLists.txt b/modules/cmsis/CMakeLists.txt index d23bcaea979..4044ae891b3 100644 --- a/modules/cmsis/CMakeLists.txt +++ b/modules/cmsis/CMakeLists.txt @@ -1,8 +1,7 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR} cmsis) - if(CONFIG_CPU_AARCH32_CORTEX_A OR CONFIG_CPU_AARCH32_CORTEX_R) + add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR} cmsis) zephyr_include_directories(.) endif() diff --git a/modules/cmsis_6/CMakeLists.txt b/modules/cmsis_6/CMakeLists.txt index 0592be9a557..16bc698857f 100644 --- a/modules/cmsis_6/CMakeLists.txt +++ b/modules/cmsis_6/CMakeLists.txt @@ -1,8 +1,7 @@ # Copyright 2025 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR} cmsis_6) - if(CONFIG_CPU_CORTEX_M) + add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR} cmsis_6) zephyr_include_directories(.) endif()