Skip to content

Commit 8bdc626

Browse files
authored
Merge pull request #14286 from 0xc0170/cmake-fix-remove-target-workaround
CMake: remove workaround for targets prior refactor
2 parents 3894d73 + 9d70cb2 commit 8bdc626

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

CMakeLists.txt

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -132,26 +132,12 @@ add_subdirectory(features EXCLUDE_FROM_ALL)
132132
add_subdirectory(cmsis/CMSIS_5/CMSIS/RTOS2 EXCLUDE_FROM_ALL)
133133
add_subdirectory(cmsis/device/rtos EXCLUDE_FROM_ALL)
134134

135-
# This is a temporary workaround to prevent the build from failing for MBED_TARGETS that
136-
# haven't been converted to build system targets yet.
137-
# The refactored MBED_TARGETS set the linker script and forward it to the build system as a
138-
# usage requirement. The 'old' mechanism was to set the linker script on the top level mbed-core
139-
# target. This was needed because MBED_TARGETS were not registered as buildsystem targets,
140-
# preventing CMake from working its usage requirements magic and forcing us to set the linker
141-
# script globally.
142-
#
143135
# Ensure the words that make up the Mbed target name are separated with a hyphen, lowercase, and with the `mbed-` prefix.
144136
string(TOLOWER ${MBED_TARGET} MBED_TARGET_CONVERTED)
145137
string(REPLACE "_" "-" MBED_TARGET_CONVERTED ${MBED_TARGET_CONVERTED})
146138
string(PREPEND MBED_TARGET_CONVERTED "mbed-")
147139

148-
# TODO: Remove when all MBED_TARGETS have been converted to build system targets.
149-
if(TARGET ${MBED_TARGET_CONVERTED})
150-
target_link_libraries(mbed-core INTERFACE ${MBED_TARGET_CONVERTED})
151-
else()
152-
get_property(LINKER_SCRIPT GLOBAL PROPERTY MBED_TARGET_LINKER_FILE)
153-
mbed_set_linker_script(mbed-core ${LINKER_SCRIPT})
154-
endif()
140+
target_link_libraries(mbed-core INTERFACE ${MBED_TARGET_CONVERTED})
155141

156142
#
157143
# Configures the application

0 commit comments

Comments
 (0)