Skip to content

CMake: Refactor Toshiba targets #14269

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

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions targets/TARGET_TOSHIBA/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if("TMPM46B" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_TMPM46B)
elseif("TMPM4G9" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_TMPM4G9)
endif()
add_subdirectory(TARGET_TMPM46B EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_TMPM4G9 EXCLUDE_FROM_ALL)

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

target_include_directories(mbed-toshiba
INTERFACE
.
)
12 changes: 8 additions & 4 deletions targets/TARGET_TOSHIBA/TARGET_TMPM46B/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if(${MBED_TOOLCHAIN} STREQUAL "ARM")
Expand All @@ -9,16 +9,16 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_TMPM46b.S)
endif()

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

target_include_directories(mbed-core
target_include_directories(mbed-tmpm46b
INTERFACE
.
device
Periph_Driver/inc
)

target_sources(mbed-core
target_sources(mbed-tmpm46b
INTERFACE
analogin_api.c
flash_api.c
Expand Down Expand Up @@ -52,3 +52,7 @@ target_sources(mbed-core

${STARTUP_FILE}
)

mbed_set_linker_script(mbed-tmpm46b ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_link_libraries(mbed-tmpm46b INTERFACE mbed-toshiba)
12 changes: 8 additions & 4 deletions targets/TARGET_TOSHIBA/TARGET_TMPM4G9/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if(${MBED_TOOLCHAIN} STREQUAL "ARM")
Expand All @@ -9,16 +9,16 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_TMPM4G9.S)
endif()

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

target_include_directories(mbed-core
target_include_directories(mbed-tmpm4g9
INTERFACE
.
device
Periph_Driver/inc
)

target_sources(mbed-core
target_sources(mbed-tmpm4g9
INTERFACE
analogin_api.c
analogout_api.c
Expand Down Expand Up @@ -54,3 +54,7 @@ target_sources(mbed-core

${STARTUP_FILE}
)

mbed_set_linker_script(mbed-tmpm4g9 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_link_libraries(mbed-tmpm4g9 INTERFACE mbed-toshiba)