Skip to content

Commit d740b0f

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

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

CMakeLists.txt

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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)