CMake: Add support for Freescale KLXX targets

All Freescale KLXX targets supported by Mbed OS
can now be built with CMake.
pull/13952/head
Hugues Kamba 2020-11-23 15:45:50 +00:00
parent b20278a5f4
commit 8ef0087314
6 changed files with 101 additions and 3 deletions

View File

@ -1,7 +1,9 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if("MCUXpresso_MCUS" IN_LIST MBED_TARGET_LABELS)
if("KLXX" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_KLXX)
elseif("MCUXpresso_MCUS" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_MCUXpresso_MCUS)
endif()

View File

@ -0,0 +1,27 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if("KL25Z" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_KL25Z)
elseif("KL46Z" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_KL46Z)
endif()
target_include_directories(mbed-core
INTERFACE
.
)
target_sources(mbed-core
INTERFACE
analogin_api.c
analogout_api.c
gpio_api.c
i2c_api.c
pinmap.c
port_api.c
pwmout_api.c
rtc_api.c
sleep.c
us_ticker.c
)

View File

@ -0,0 +1,34 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MKL25Z4.sct)
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_MKL25Z4.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/MKL25Z4.ld)
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MKL25Z4.S)
endif()
set_property(
GLOBAL PROPERTY
MBED_TARGET_LINKER_FILE
${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}
)
target_include_directories(mbed-core
INTERFACE
.
device
)
target_sources(mbed-core
INTERFACE
PeripheralPins.c
gpio_irq_api.c
mbed_overrides.c
serial_api.c
spi_api.c
device/system_MKL25Z4.c
${STARTUP_FILE}
)

View File

@ -1,4 +1,4 @@
#! armcc -E
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m0plus
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
# if defined(MBED_BOOT_STACK_SIZE)

View File

@ -0,0 +1,35 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MKL46Z4.sct)
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_MKL46Z4.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/MKL46Z4.ld)
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MKL46Z4.S)
endif()
set_property(
GLOBAL PROPERTY
MBED_TARGET_LINKER_FILE
${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}
)
target_include_directories(mbed-core
INTERFACE
.
device
)
target_sources(mbed-core
INTERFACE
PeripheralPins.c
flash_api.c
gpio_irq_api.c
mbed_overrides.c
serial_api.c
spi_api.c
device/system_MKL46Z4.c
${STARTUP_FILE}
)

View File

@ -1,4 +1,4 @@
#! armcc -E
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m0plus
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
# if defined(MBED_BOOT_STACK_SIZE)