Skip to content

Commit 8eb7916

Browse files
committed
- Add the check for profile requested supported in
suported_application_profiles
1 parent d64133e commit 8eb7916

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

CMakeLists.txt

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ function(mbed_generate_map_file target)
185185
TARGET
186186
${target}
187187
POST_BUILD
188-
COMMAND ${Python3_EXECUTABLE} ${MBED_ROOT}/tools/memap.py -t ${MBED_TOOLCHAIN} -d 4 ${CMAKE_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map
188+
COMMAND ${Python3_EXECUTABLE} ${MBED_ROOT}/tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map
189189
WORKING_DIRECTORY
190190
${CMAKE_BINARY_DIR}
191191
COMMENT
@@ -194,9 +194,28 @@ function(mbed_generate_map_file target)
194194
endfunction()
195195

196196
#
197-
# Generate executables
197+
# Validate selected application profile.
198198
#
199-
function(mbed_generate_executable target)
199+
function(mbed_validate_application_profile target)
200+
get_target_property(app_link_libraries ${target} LINK_LIBRARIES)
201+
string(REGEX MATCH "mbed-baremetal"
202+
output_string ${app_link_libraries})
203+
if(${output_string} STREQUAL "mbed-baremetal")
204+
if(NOT "bare-metal" IN_LIST MBED_TARGET_SUPPORTED_APPLICATION_PROFILES)
205+
message(FATAL_ERROR
206+
"Use full profile as baremetal profile is not supported for this Mbed target")
207+
endif()
208+
elseif(NOT "full" IN_LIST MBED_TARGET_SUPPORTED_APPLICATION_PROFILES)
209+
message(FATAL_ERROR
210+
"The full profile is not supported for this Mbed target")
211+
endif()
212+
endfunction()
213+
214+
#
215+
# Prepare post target build step
216+
#
217+
function(mbed_post_target_build target)
218+
mbed_validate_application_profile(${target})
200219
mbed_generate_bin_hex(${target})
201220
mbed_generate_map_file(${target})
202221
endfunction()

0 commit comments

Comments
 (0)