mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #13985 from 0xc0170/cmake-fix-13983
CMake: fix memory map generationpull/14001/head
commit
a847ab3708
|
@ -141,12 +141,18 @@ function(mbed_set_mbed_target_linker_script target)
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
BYPRODUCTS "${CMAKE_BINARY_DIR}/${target}.link_script.ld"
|
BYPRODUCTS "${CMAKE_BINARY_DIR}/${target}.link_script.ld"
|
||||||
)
|
)
|
||||||
|
target_link_options(mbed-core
|
||||||
|
INTERFACE
|
||||||
|
"-T" "${CMAKE_BINARY_DIR}/${target}.link_script.ld"
|
||||||
|
"-Wl,-Map=${CMAKE_BINARY_DIR}/${target}.map"
|
||||||
|
)
|
||||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||||
set(CMAKE_PRE_BUILD_COMMAND COMMAND "")
|
set(CMAKE_PRE_BUILD_COMMAND COMMAND "")
|
||||||
target_link_options(mbed-core
|
target_link_options(mbed-core
|
||||||
INTERFACE
|
INTERFACE
|
||||||
"--scatter=${mbed_target_linker_script}"
|
"--scatter=${mbed_target_linker_script}"
|
||||||
"--predefine=${_linker_preprocess_definitions}"
|
"--predefine=${_linker_preprocess_definitions}"
|
||||||
|
"--map"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
|
|
@ -39,10 +39,6 @@ function(mbed_set_toolchain_options target)
|
||||||
$<$<COMPILE_LANGUAGE:ASM>:--target=arm-arm-none-eabi -masm=auto>
|
$<$<COMPILE_LANGUAGE:ASM>:--target=arm-arm-none-eabi -masm=auto>
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND link_options
|
|
||||||
"--map"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Add linking time preprocessor macro for TFM targets
|
# Add linking time preprocessor macro for TFM targets
|
||||||
if(MBED_CPU_CORE MATCHES "\-NS$")
|
if(MBED_CPU_CORE MATCHES "\-NS$")
|
||||||
list(APPEND link_options
|
list(APPEND link_options
|
||||||
|
|
|
@ -19,8 +19,6 @@ function(mbed_set_toolchain_options target)
|
||||||
"-lnosys"
|
"-lnosys"
|
||||||
"-Wl,--end-group"
|
"-Wl,--end-group"
|
||||||
"-specs=nosys.specs"
|
"-specs=nosys.specs"
|
||||||
"-T" "${CMAKE_BINARY_DIR}/${APP_TARGET}.link_script.ld"
|
|
||||||
"-Wl,-Map=${CMAKE_BINARY_DIR}/${APP_TARGET}.map"
|
|
||||||
"-Wl,--cref"
|
"-Wl,--cref"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue