zephyr/modules/hal_infineon/CMakeLists.txt
Nazar Palamar 90a0dd6d6f modules: hal_infineon: fix CMake Warning when build non Infineon device
Problem:
pull/43494 is causing the CMake warning
No SOURCES given to Zephyr library: modules_hal_infineon

modules_hal_infineon library was defined even if none of the
below subdirectories is added; so, when not building for
Infineon/Cypress devices, the source list for this library
will be empty.

Fix:
Added 'zephyr_library_named(modules_hal_infineon)' under condition
'if(CONFIG_HAS_XMCLIB OR CONFIG_SOC_FAMILY_PSOC6)'

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2022-05-16 10:17:29 +02:00

21 lines
552 B
CMake

# Copyright (c) 2020 Linumiz
# Copyright (c) 2022 Cypress Semiconductor Corporation.
# SPDX-License-Identifier: Apache-2.0
if(CONFIG_HAS_XMCLIB OR CONFIG_SOC_FAMILY_PSOC6)
zephyr_library_named(modules_hal_infineon)
endif()
## Add PDL sources for XMC devices
if (CONFIG_HAS_XMCLIB)
add_subdirectory(${ZEPHYR_HAL_INFINEON_MODULE_DIR}/XMCLib XMCLib)
endif()
if (CONFIG_SOC_FAMILY_PSOC6)
## Add core-lib sources for CAT1 devices
add_subdirectory(core-lib)
## Add mtb-pdl-cat1 sources for CAT1 devices
add_subdirectory(mtb-pdl-cat1)
endif()