Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: refactor Renesas targets #14253

Merged
merged 1 commit into from Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions targets/TARGET_RENESAS/CMakeLists.txt
@@ -1,13 +1,12 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if ("RZ_A1XX" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_RZ_A1XX)
elseif("RZ_A2XX" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_RZ_A2XX)
endif()
add_subdirectory(TARGET_RZ_A1XX EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_RZ_A2XX EXCLUDE_FROM_ALL)

target_include_directories(mbed-core
add_library(mbed-renesas INTERFACE)

target_include_directories(mbed-renesas
INTERFACE
.
)
15 changes: 8 additions & 7 deletions targets/TARGET_RENESAS/TARGET_RZ_A1XX/CMakeLists.txt
@@ -1,19 +1,18 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if ("GR_LYCHEE" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_GR_LYCHEE)
elseif("RZ_A1H" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_RZ_A1H)
endif()
add_subdirectory(TARGET_GR_LYCHEE EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_RZ_A1H EXCLUDE_FROM_ALL)

target_include_directories(mbed-core
add_library(mbed-rz-a1xx INTERFACE)

target_include_directories(mbed-rz-a1xx
INTERFACE
.
common
)

target_sources(mbed-core
target_sources(mbed-rz-a1xx
INTERFACE
analogin_api.c
can_api.c
Expand All @@ -35,3 +34,5 @@ target_sources(mbed-core

common/rza_io_regrw.c
)

target_link_libraries(mbed-rz-a1xx INTERFACE mbed-renesas)
Expand Up @@ -11,10 +11,10 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(WEAK_HANDLER_FILE device/TOOLCHAIN_GCC_ARM/weak_handler.S)
endif()

set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
add_library(mbed-gr-lychee INTERFACE)


target_include_directories(mbed-core
target_include_directories(mbed-gr-lychee
INTERFACE
.
device
Expand All @@ -23,7 +23,7 @@ target_include_directories(mbed-core
device/inc/iodefines
)

target_sources(mbed-core
target_sources(mbed-gr-lychee
INTERFACE
trng_api_esp32.cpp
PeripheralPins.c
Expand All @@ -40,3 +40,6 @@ target_sources(mbed-core
${WEAK_HANDLER_FILE}
)

mbed_set_linker_script(mbed-gr-lychee ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_link_libraries(mbed-gr-lychee INTERFACE mbed-rz-a1xx)
Expand Up @@ -11,10 +11,9 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(WEAK_HANDLER_FILE device/TOOLCHAIN_GCC_ARM/weak_handler.S)
endif()

set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
add_library(mbed-rz-a1h INTERFACE)


target_include_directories(mbed-core
target_include_directories(mbed-rz-a1h
INTERFACE
.
device
Expand All @@ -23,7 +22,7 @@ target_include_directories(mbed-core
device/inc/iodefines
)

target_sources(mbed-core
target_sources(mbed-rz-a1h
INTERFACE
PeripheralPins.c

Expand All @@ -38,3 +37,7 @@ target_sources(mbed-core
${STARTUP_FILE}
${WEAK_HANDLER_FILE}
)

mbed_set_linker_script(mbed-rz-a1h ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_link_libraries(mbed-rz-a1h INTERFACE mbed-rz-a1xx)
12 changes: 7 additions & 5 deletions targets/TARGET_RENESAS/TARGET_RZ_A2XX/CMakeLists.txt
@@ -1,11 +1,11 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if ("GR_MANGO" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_GR_MANGO)
endif()
add_subdirectory(TARGET_GR_MANGO EXCLUDE_FROM_ALL)

target_include_directories(mbed-core
add_library(mbed-rz-a2xx INTERFACE)

target_include_directories(mbed-rz-a2xx
INTERFACE
.
common
Expand All @@ -14,7 +14,7 @@ target_include_directories(mbed-core
r_can/inc
)

target_sources(mbed-core
target_sources(mbed-rz-a2xx
INTERFACE
analogin_api.c
can_api.c
Expand All @@ -38,3 +38,5 @@ target_sources(mbed-core

r_can/src/r_can_rz.c
)

target_link_libraries(mbed-rz-a2xx INTERFACE mbed-renesas)
Expand Up @@ -11,10 +11,9 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(WEAK_HANDLER_FILE device/TOOLCHAIN_GCC_ARM/weak_handler.S)
endif()

set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
add_library(mbed-gr-mango INTERFACE)


target_include_directories(mbed-core
target_include_directories(mbed-gr-mango
INTERFACE
.
device
Expand All @@ -24,7 +23,7 @@ target_include_directories(mbed-core
device/inc/iodefine/iodefines
)

target_sources(mbed-core
target_sources(mbed-gr-mango
INTERFACE
PeripheralPins.c

Expand All @@ -40,3 +39,7 @@ target_sources(mbed-core
${STARTUP_FILE}
${WEAK_HANDLER_FILE}
)

mbed_set_linker_script(mbed-gr-mango ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_link_libraries(mbed-gr-mango INTERFACE mbed-rz-a2xx)