@@ -71,40 +71,12 @@ function(mbed_configure_app_target target)
71
71
mbed_set_language_standard (${target} )
72
72
endfunction ()
73
73
74
- # GCC ARM requires preprecessing linker script, execute generators to get definitions needed for
75
- # this step - linker options and compile definitions
76
- if (MBED_TOOLCHAIN STREQUAL "GCC_ARM" )
77
-
78
- # Get definitions - we need them for linker preprocessing
79
- set (_compile_definitions
80
- "$<TARGET_PROPERTY:mbed-os,COMPILE_DEFINITIONS>"
81
- )
82
-
83
- set (_linker_options
84
- "$<TARGET_PROPERTY:mbed-os,LINK_OPTIONS>"
85
- )
86
-
87
- set (_compile_definitions
88
- "$<$<BOOL:${_compile_definitions} >:-D$<JOIN:${_compile_definitions} , -D>>"
89
- )
90
-
91
- function (generate_definitions )
92
- file (GENERATE OUTPUT "${CMAKE_BINARY_DIR} /compile_time_defs.txt" CONTENT "${_compile_definitions} \n " )
93
- file (GENERATE OUTPUT "${CMAKE_BINARY_DIR} /linker_options.txt" CONTENT "${_linker_options} \n " )
94
- endfunction ()
95
-
96
- generate_definitions ()
97
- set (_linker_preprocess_definitions @${CMAKE_BINARY_DIR}/compile_time_defs.txt )
98
- set (_linker_preprocess_options @${CMAKE_BINARY_DIR}/linker_options.txt )
99
-
100
- endif ()
101
-
102
74
#
103
75
# Specifies linker script used for linking `target`.
104
76
#
105
77
function (mbed_set_mbed_target_linker_script target )
106
78
get_property (mbed_target_linker_script GLOBAL PROPERTY MBED_TARGET_LINKER_FILE )
107
-
79
+ mbed_generate_gcc_options_for_linker ( mbed-os _linker_preprocess_definitions _linker_preprocess_options )
108
80
if (MBED_TOOLCHAIN STREQUAL "GCC_ARM" )
109
81
set (CMAKE_PRE_BUILD_COMMAND
110
82
COMMAND "arm-none-eabi-cpp" -E -P
0 commit comments