diff --git a/modules/hal_nxp/CMakeLists.txt b/modules/hal_nxp/CMakeLists.txt index a4f3842cac..572b0bc654 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()