Skip to content

Commit 90e9285

Browse files
committed
Support application profile link selection
This provides one approach to address cmake link mess with mbed-core-flags/ mbed-rtos-flags whose links or not depends on selected application profile, full or bare-metal. 1. Add target config option application-profile for application to select which application profile to use. Applications are responsible for make this target config option consitent with link selection of mbed-os/mbed-baremetal. 2. Add cmake interface library mbed-application-profile-flags. It is to substitute for mbed-core-flags/mbed-rtos-flags. Library camke targets should change to link this one to build upon correct application profile selection.
1 parent a0487d8 commit 90e9285

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ add_library(mbed-rtos-sources INTERFACE) # Collects source files that are in mbe
121121
add_library(mbed-core-flags INTERFACE) # Collects flags common to mbed-baremetal and mbed-os
122122
add_library(mbed-core-sources INTERFACE) # Collects source files common to mbed-baremetal and mbed-os
123123

124+
# Add mbed-application-profile-flags which is to substitue for mbed-core-flags/
125+
# mbed-rtos-flags whose linking need to depend on selected application profile
126+
add_library(mbed-application-profile-flags INTERFACE)
127+
target_link_libraries(mbed-application-profile-flags INTERFACE mbed-core-flags)
128+
if("MBED_CONF_TARGET_APPLICATION_PROFILE=full" IN_LIST MBED_CONFIG_DEFINITIONS)
129+
target_link_libraries(mbed-application-profile-flags INTERFACE mbed-rtos-flags)
130+
endif()
131+
124132
# Validate selected C library type
125133
# The C library type selected has to match the library that the target can support
126134
if(NOT MBED_IS_NATIVE_BUILD)

targets/targets.json5

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@
100100
"semihosting-enabled": {
101101
"help": "Enable ARM Semihosting protocol. This uses a magic breakpoint instruction to enable the MCU to print data to and access files on a host machine. However, it can interfere with debuggers that are not semihost aware.",
102102
"value": false
103+
},
104+
"application-profile": {
105+
"help": "Select application profile",
106+
"accepted_values": ["full", "bare-metal"],
107+
"value": "full"
103108
}
104109
}
105110
},

0 commit comments

Comments
 (0)