Skip to content

Commit 0d19bd3

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

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

CMakeLists.txt

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,27 @@ 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(FIND ${app_link_libraries} "mbed-baremetal" string_found_position)
202+
if(${string_found_position} GREATER_EQUAL 0)
203+
if(NOT "bare-metal" IN_LIST MBED_TARGET_SUPPORTED_APPLICATION_PROFILES)
204+
message(FATAL_ERROR
205+
"Use full profile as baremetal profile is not supported for this Mbed target")
206+
endif()
207+
elseif(NOT "full" IN_LIST MBED_TARGET_SUPPORTED_APPLICATION_PROFILES)
208+
message(FATAL_ERROR
209+
"The full profile is not supported for this Mbed target")
210+
endif()
211+
endfunction()
212+
213+
#
214+
# Set post build operations
215+
#
216+
function(mbed_set_post_build target)
217+
mbed_validate_application_profile(${target})
200218
mbed_generate_bin_hex(${target})
201219
mbed_generate_map_file(${target})
202220
endfunction()

0 commit comments

Comments
 (0)