mirror of https://github.com/ARMmbed/mbed-os.git
CMake: move Gcc Arm memmap to configure app
This allows us to keep all in one place and fix (removing this function later)pull/14265/head
parent
8be5da2619
commit
207dcbb88b
|
@ -136,6 +136,7 @@ endif()
|
||||||
|
|
||||||
#
|
#
|
||||||
# Configures the application
|
# Configures the application
|
||||||
|
# Note, this function will be removed in the next revisions
|
||||||
#
|
#
|
||||||
function(mbed_configure_app_target target)
|
function(mbed_configure_app_target target)
|
||||||
# We need to generate a "response file" to pass to the C preprocessor because of path length
|
# We need to generate a "response file" to pass to the C preprocessor because of path length
|
||||||
|
@ -146,6 +147,16 @@ function(mbed_configure_app_target target)
|
||||||
# using global properties.
|
# using global properties.
|
||||||
mbed_generate_options_for_linker(${target} LINKER_PREPROCESS_DEFINITIONS)
|
mbed_generate_options_for_linker(${target} LINKER_PREPROCESS_DEFINITIONS)
|
||||||
set_property(GLOBAL PROPERTY COMPILE_DEFS_RESPONSE_FILE ${LINKER_PREPROCESS_DEFINITIONS})
|
set_property(GLOBAL PROPERTY COMPILE_DEFS_RESPONSE_FILE ${LINKER_PREPROCESS_DEFINITIONS})
|
||||||
|
|
||||||
|
# Gcc Arm requires memap to be set with app name, equally to ARMClang
|
||||||
|
# TODO: move this to toolchain and set properly
|
||||||
|
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||||
|
message(${target})
|
||||||
|
target_link_options(mbed-core
|
||||||
|
INTERFACE
|
||||||
|
"-Wl,-Map=${CMAKE_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -35,11 +35,9 @@ function(mbed_set_linker_script input_target raw_linker_script_path)
|
||||||
set(LinkerScriptTarget ${input_target}LinkerScript)
|
set(LinkerScriptTarget ${input_target}LinkerScript)
|
||||||
add_custom_target(${LinkerScriptTarget} DEPENDS ${LINKER_SCRIPT_PATH} VERBATIM)
|
add_custom_target(${LinkerScriptTarget} DEPENDS ${LINKER_SCRIPT_PATH} VERBATIM)
|
||||||
add_dependencies(${input_target} ${LinkerScriptTarget})
|
add_dependencies(${input_target} ${LinkerScriptTarget})
|
||||||
# We hardcore mmemory file to "application"
|
|
||||||
target_link_options(${input_target}
|
target_link_options(${input_target}
|
||||||
INTERFACE
|
INTERFACE
|
||||||
"-T" "${LINKER_SCRIPT_PATH}"
|
"-T" "${LINKER_SCRIPT_PATH}"
|
||||||
"-Wl,-Map=${CMAKE_BINARY_DIR}/application${CMAKE_EXECUTABLE_SUFFIX}.map"
|
|
||||||
)
|
)
|
||||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||||
target_link_options(${input_target}
|
target_link_options(${input_target}
|
||||||
|
|
Loading…
Reference in New Issue