File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ function(mbed_generate_map_file target)
205205 TARGET
206206 ${target}
207207 POST_BUILD
208- COMMAND ${Python3_EXECUTABLE} ${MBED_ROOT } /tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map
208+ COMMAND ${Python3_EXECUTABLE} ${MBED_PATH } /tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map
209209 WORKING_DIRECTORY
210210 ${CMAKE_BINARY_DIR}
211211 COMMENT
@@ -214,9 +214,27 @@ function(mbed_generate_map_file target)
214214endfunction ()
215215
216216#
217- # Generate executables
217+ # Validate selected application profile.
218218#
219- function (mbed_generate_executable target )
219+ function (mbed_validate_application_profile target )
220+ get_target_property (app_link_libraries ${target} LINK_LIBRARIES )
221+ string (FIND "${app_link_libraries} " "mbed-baremetal" string_found_position)
222+ if (${string_found_position} GREATER_EQUAL 0)
223+ if (NOT "bare-metal" IN_LIST MBED_TARGET_SUPPORTED_APPLICATION_PROFILES)
224+ message (FATAL_ERROR
225+ "Use full profile as baremetal profile is not supported for this Mbed target" )
226+ endif ()
227+ elseif (NOT "full" IN_LIST MBED_TARGET_SUPPORTED_APPLICATION_PROFILES)
228+ message (FATAL_ERROR
229+ "The full profile is not supported for this Mbed target" )
230+ endif ()
231+ endfunction ()
232+
233+ #
234+ # Set post build operations
235+ #
236+ function (mbed_set_post_build target )
237+ mbed_validate_application_profile(${target} )
220238 mbed_generate_bin_hex(${target} )
221239 mbed_generate_map_file(${target} )
222240endfunction ()
You can’t perform that action at this time.
0 commit comments