diff --git a/targets/TARGET_Maxim/CMakeLists.txt b/targets/TARGET_Maxim/CMakeLists.txt index 3b4402d853..b521028062 100644 --- a/targets/TARGET_Maxim/CMakeLists.txt +++ b/targets/TARGET_Maxim/CMakeLists.txt @@ -7,15 +7,23 @@ add_subdirectory(TARGET_MAX32625 EXCLUDE_FROM_ALL) add_subdirectory(TARGET_MAX32630 EXCLUDE_FROM_ALL) add_library(mbed-maxim INTERFACE) +add_library(mbed-maxim-obj OBJECT) target_include_directories(mbed-maxim INTERFACE . ) -target_sources(mbed-maxim - INTERFACE +target_sources(mbed-maxim-obj + PRIVATE USBPhy_Maxim.cpp ) + +set_property(TARGET mbed-maxim PROPERTY INTERFACE_SOURCES $) + +foreach(options COMPILE_DEFINITIONS COMPILE_FEATURES COMPILE_OPTIONS INCLUDE_DIRECTORIES LINK_LIBRARIES) + set_target_properties(mbed-maxim-obj PROPERTIES ${options} $) +endforeach() + target_link_libraries(mbed-maxim INTERFACE mbed-cmsis-cortex-m) diff --git a/targets/TARGET_Maxim/TARGET_MAX32630/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32630/CMakeLists.txt index 1adf3612cc..091d2683cc 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32630/CMakeLists.txt +++ b/targets/TARGET_Maxim/TARGET_MAX32630/CMakeLists.txt @@ -18,6 +18,7 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") endif() add_library(mbed-max32630 INTERFACE) +add_library(mbed-max32630-obj OBJECT) mbed_set_linker_script(mbed-max32630 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) @@ -28,8 +29,8 @@ target_include_directories(mbed-max32630 mxc ) -target_sources(mbed-max32630 - INTERFACE +target_sources(mbed-max32630-obj + PRIVATE PeripheralPins.c analogin_api.c gpio_api.c @@ -77,6 +78,12 @@ target_sources(mbed-max32630 ${STARTUP_FILE} ) +set_property(TARGET mbed-max32630 PROPERTY INTERFACE_SOURCES $) + +foreach(options COMPILE_DEFINITIONS COMPILE_FEATURES COMPILE_OPTIONS INCLUDE_DIRECTORIES LINK_LIBRARIES) + set_target_properties(mbed-max32630-obj PROPERTIES ${options} $) +endforeach() + target_link_libraries(mbed-max32630 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_EXACT_LE} diff --git a/targets/TARGET_Maxim/TARGET_MAX32630/TARGET_MAX32630FTHR/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32630/TARGET_MAX32630FTHR/CMakeLists.txt index db06d4cc26..a59057c1b6 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32630/TARGET_MAX32630FTHR/CMakeLists.txt +++ b/targets/TARGET_Maxim/TARGET_MAX32630/TARGET_MAX32630FTHR/CMakeLists.txt @@ -2,15 +2,22 @@ # SPDX-License-Identifier: Apache-2.0 add_library(mbed-max32630fthr INTERFACE) +add_library(mbed-max32630fthr-obj OBJECT) target_include_directories(mbed-max32630fthr INTERFACE . ) -target_sources(mbed-max32630fthr - INTERFACE +target_sources(mbed-max32630fthr-obj + PRIVATE low_level_init.c ) +set_property(TARGET mbed-max32630fthr PROPERTY INTERFACE_SOURCES $) + +foreach(options COMPILE_DEFINITIONS COMPILE_FEATURES COMPILE_OPTIONS INCLUDE_DIRECTORIES LINK_LIBRARIES) + set_target_properties(mbed-max32630fthr-obj PROPERTIES ${options} $) +endforeach() + target_link_libraries(mbed-max32630fthr INTERFACE mbed-max32630)