From 3a3cfbb652b29e9f39a38fe6febf29e1570d32bc Mon Sep 17 00:00:00 2001 From: Yonatan Schachter Date: Tue, 1 Nov 2022 18:30:45 +0200 Subject: [PATCH] hal: nxp: Check Kconfig before including HAL hal_nxp was added to cmake's include directories globally, without checking if the hal is enabled. This made all Zephyr builds end up including hal_nxp, even for other vendors. Signed-off-by: Yonatan Schachter --- modules/hal_nxp/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/hal_nxp/CMakeLists.txt b/modules/hal_nxp/CMakeLists.txt index a4f3842caca..572b0bc6540 100644 --- a/modules/hal_nxp/CMakeLists.txt +++ b/modules/hal_nxp/CMakeLists.txt @@ -4,7 +4,9 @@ # SPDX-License-Identifier: Apache-2.0 # -add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR} hal_nxp) -add_subdirectory_ifdef(CONFIG_USB_DEVICE_DRIVER usb) +if(CONFIG_HAS_MCUX OR CONFIG_HAS_IMX_HAL OR CONFIG_HAS_S32_HAL) + add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR} hal_nxp) + add_subdirectory_ifdef(CONFIG_USB_DEVICE_DRIVER usb) -zephyr_include_directories(.) + zephyr_include_directories(.) +endif()