mirror of https://github.com/ARMmbed/mbed-os.git
CMake: Validate selected application profile (#13856)
Check if the selected application profile is supported by the selected Mbed Targetpull/13566/head
parent
66f65c0e89
commit
073ae1d343
|
@ -205,7 +205,7 @@ function(mbed_generate_map_file target)
|
||||||
TARGET
|
TARGET
|
||||||
${target}
|
${target}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${Python3_EXECUTABLE} ${MBED_ROOT}/tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map
|
COMMAND ${Python3_EXECUTABLE} ${MBED_PATH}/tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map
|
||||||
WORKING_DIRECTORY
|
WORKING_DIRECTORY
|
||||||
${CMAKE_BINARY_DIR}
|
${CMAKE_BINARY_DIR}
|
||||||
COMMENT
|
COMMENT
|
||||||
|
@ -214,9 +214,27 @@ function(mbed_generate_map_file target)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
#
|
#
|
||||||
# Generate executables
|
# Validate selected application profile.
|
||||||
#
|
#
|
||||||
function(mbed_generate_executable target)
|
function(mbed_validate_application_profile target)
|
||||||
|
get_target_property(app_link_libraries ${target} LINK_LIBRARIES)
|
||||||
|
string(FIND "${app_link_libraries}" "mbed-baremetal" string_found_position)
|
||||||
|
if(${string_found_position} GREATER_EQUAL 0)
|
||||||
|
if(NOT "bare-metal" IN_LIST MBED_TARGET_SUPPORTED_APPLICATION_PROFILES)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"Use full profile as baremetal profile is not supported for this Mbed target")
|
||||||
|
endif()
|
||||||
|
elseif(NOT "full" IN_LIST MBED_TARGET_SUPPORTED_APPLICATION_PROFILES)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"The full profile is not supported for this Mbed target")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Set post build operations
|
||||||
|
#
|
||||||
|
function(mbed_set_post_build target)
|
||||||
|
mbed_validate_application_profile(${target})
|
||||||
mbed_generate_bin_hex(${target})
|
mbed_generate_bin_hex(${target})
|
||||||
mbed_generate_map_file(${target})
|
mbed_generate_map_file(${target})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
Loading…
Reference in New Issue