Skip to content

Commit 8f1840e

Browse files
committed
Analog Devices: refactor CMake targets
1 parent 0f000a0 commit 8f1840e

File tree

7 files changed

+59
-52
lines changed

7 files changed

+59
-52
lines changed
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if("ADUCM302X" IN_LIST MBED_TARGET_LABELS)
5-
add_subdirectory(TARGET_ADUCM302X)
6-
elseif("ADUCM4X50" IN_LIST MBED_TARGET_LABELS)
7-
add_subdirectory(TARGET_ADUCM4X50)
8-
endif()
4+
add_subdirectory(TARGET_ADUCM302X EXCLUDE_FROM_ALL)
5+
add_subdirectory(TARGET_ADUCM4X50 EXCLUDE_FROM_ALL)
96

10-
target_include_directories(mbed-core
7+
add_library(Analog_Devices INTERFACE)
8+
9+
target_include_directories(Analog_Devices
1110
INTERFACE
1211
.
1312
)
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if("ADUCM3029" IN_LIST MBED_TARGET_LABELS)
5-
add_subdirectory(TARGET_ADUCM3029)
6-
endif()
4+
add_subdirectory(TARGET_ADUCM3029 EXCLUDE_FROM_ALL)
5+

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/CMakeLists.txt

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,19 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
add_subdirectory(TARGET_EV_COG_AD3029LZ EXCLUDE_FROM_ALL)
5+
6+
add_library(ADUCM3029 INTERFACE)
7+
48
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
59
set(LINKER_FILE TOOLCHAIN_ARM_STD/ADuCM3029.sct)
610
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
711
set(LINKER_FILE TOOLCHAIN_GCC_ARM/ADuCM3029.ld)
812
endif()
913

10-
if ("EV_COG_AD3029LZ" IN_LIST MBED_TARGET_LABELS)
11-
target_include_directories(mbed-core
12-
INTERFACE
13-
TARGET_EV_COG_AD3029LZ
14-
TARGET_EV_COG_AD3029LZ/device
15-
)
14+
mbed_set_linker_script(ADUCM3029 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
1615

17-
target_sources(mbed-core
18-
INTERFACE
19-
TARGET_EV_COG_AD3029LZ/device/system_ADuCM3029.c
20-
)
21-
22-
set(STARTUP_FILE TARGET_EV_COG_AD3029LZ/device/startup_ADuCM3029.c)
23-
endif()
24-
25-
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
26-
27-
target_include_directories(mbed-core
16+
target_include_directories(ADUCM3029
2817
INTERFACE
2918
api
3019
bsp
@@ -65,7 +54,7 @@ target_include_directories(mbed-core
6554
bsp/xint
6655
)
6756

68-
target_sources(mbed-core
57+
target_sources(ADUCM3029
6958
INTERFACE
7059
api/analogin_api.c
7160
api/flash_api.c
@@ -121,6 +110,4 @@ target_sources(mbed-core
121110
bsp/wdt/adi_wdt.c
122111

123112
bsp/xint/adi_xint.c
124-
125-
${STARTUP_FILE}
126113
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_library(EV_COG_AD3029LZ INTERFACE)
5+
6+
target_include_directories(EV_COG_AD3029LZ
7+
INTERFACE
8+
.
9+
device
10+
)
11+
12+
target_sources(EV_COG_AD3029LZ
13+
INTERFACE
14+
device/system_ADuCM3029.c
15+
device/startup_ADuCM3029.c
16+
)
17+
18+
target_link_libraries(EV_COG_AD3029LZ INTERFACE Analog_Devices ADUCM3029)
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if ("ADUCM4050" IN_LIST MBED_TARGET_LABELS)
5-
add_subdirectory(TARGET_ADUCM4050)
6-
endif()
4+
add_subdirectory(TARGET_ADUCM4050 EXCLUDE_FROM_ALL)
5+

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/CMakeLists.txt

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,19 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
add_subdirectory(TARGET_EV_COG_AD4050LZ EXCLUDE_FROM_ALL)
5+
6+
add_library(ADUCM4050 INTERFACE)
7+
48
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
59
set(LINKER_FILE TOOLCHAIN_GCC_ARM/ADuCM4050.ld)
610
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
711
set(LINKER_FILE TOOLCHAIN_ARM_STD/ADuCM4050.sct)
812
endif()
913

10-
if("EV_COG_AD4050LZ" IN_LIST MBED_TARGET_LABELS)
11-
target_include_directories(mbed-core
12-
INTERFACE
13-
TARGET_EV_COG_AD4050LZ
14-
TARGET_EV_COG_AD4050LZ/device
15-
)
14+
mbed_set_linker_script(ADUCM4050 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
1615

17-
target_sources(mbed-core
18-
INTERFACE
19-
TARGET_EV_COG_AD4050LZ/device/system_ADuCM4050.c
20-
)
21-
22-
set(STARTUP_FILE TARGET_EV_COG_AD4050LZ/device/startup_ADuCM4050.c)
23-
endif()
24-
25-
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
26-
27-
target_include_directories(mbed-core
16+
target_include_directories(ADUCM4050
2817
INTERFACE
2918
api
3019
bsp
@@ -65,7 +54,7 @@ target_include_directories(mbed-core
6554
bsp/xint
6655
)
6756

68-
target_sources(mbed-core
57+
target_sources(ADUCM4050
6958
INTERFACE
7059
api/analogin_api.c
7160
api/flash_api.c
@@ -121,6 +110,4 @@ target_sources(mbed-core
121110
bsp/wdt/adi_wdt.c
122111

123112
bsp/xint/adi_xint.c
124-
125-
${STARTUP_FILE}
126113
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_library(EV_COG_AD4050LZ INTERFACE)
5+
6+
target_include_directories(EV_COG_AD4050LZ
7+
INTERFACE
8+
.
9+
device
10+
)
11+
12+
target_sources(EV_COG_AD4050LZ
13+
INTERFACE
14+
device/system_ADuCM4050.c
15+
device/startup_ADuCM4050.c
16+
)
17+
18+
target_link_libraries(EV_COG_AD4050LZ INTERFACE Analog_Devices ADUCM4050)

0 commit comments

Comments
 (0)