Skip to content

Commit 4acc57c

Browse files
hugueskamba0xc0170
authored andcommitted
CMake: Add support for LPC11XX_11CXX targets
All LPC11XX_11CXX targets supported by Mbed OS can now be built with CMake.
1 parent 229b9ad commit 4acc57c

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

targets/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ elseif("NORDIC" IN_LIST MBED_TARGET_LABELS)
1515
add_subdirectory(TARGET_NORDIC)
1616
elseif("NUVOTON" IN_LIST MBED_TARGET_LABELS)
1717
add_subdirectory(TARGET_NUVOTON)
18+
elseif("NXP" IN_LIST MBED_TARGET_LABELS)
19+
add_subdirectory(TARGET_NXP)
1820
elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS)
1921
add_subdirectory(TARGET_Silicon_Labs)
2022
elseif("STM" IN_LIST MBED_TARGET_LABELS)

targets/TARGET_NXP/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("LPC11XX_11CXX" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_LPC11XX_11CXX)
6+
elseif("LPC176X" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_LPC176X)
8+
elseif("MCUXpresso_MCUS" IN_LIST MBED_TARGET_LABELS)
9+
add_subdirectory(TARGET_MCUXpresso_MCUS)
10+
endif()
11+
12+
target_include_directories(mbed-core
13+
INTERFACE
14+
.
15+
)
16+
17+
target_sources(mbed-core
18+
INTERFACE
19+
USBHAL_LPC17.cpp
20+
)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("LPC11XX" IN_LIST MBED_TARGET_LABELS)
5+
target_include_directories(mbed-core
6+
INTERFACE
7+
TARGET_LPC11XX
8+
)
9+
10+
target_sources(mbed-core
11+
INTERFACE
12+
TARGET_LPC11XX/device/system_LPC11xx.c
13+
)
14+
15+
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
16+
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/TARGET_LPC11XX/startup_LPC11xx.S)
17+
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/TARGET_LPC11XX/LPC1114.sct)
18+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
19+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_LPC11xx.S)
20+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/TARGET_LPC11XX/LPC1114.ld)
21+
endif()
22+
endif()
23+
24+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
25+
26+
target_include_directories(mbed-core
27+
INTERFACE
28+
.
29+
device
30+
)
31+
32+
target_sources(mbed-core
33+
INTERFACE
34+
analogin_api.c
35+
gpio_api.c
36+
gpio_irq_api.c
37+
i2c_api.c
38+
pinmap.c
39+
port_api.c
40+
pwmout_api.c
41+
serial_api.c
42+
sleep.c
43+
spi_api.c
44+
us_ticker.c
45+
46+
device/cmsis_nvic.c
47+
${STARTUP_FILE}
48+
)

0 commit comments

Comments
 (0)