@@ -57,6 +57,13 @@ if(${MBED_TOOLCHAIN_FILE_USED})
57
57
mbed_set_profile_options (mbed-core ${MBED_TOOLCHAIN} )
58
58
mbed_set_c_lib (mbed-core ${MBED_C_LIB} )
59
59
mbed_set_printf_lib (mbed-core ${MBED_PRINTF_LIB} )
60
+
61
+ target_compile_features (mbed-core
62
+ INTERFACE
63
+ c_std_11
64
+ cxx_std_14
65
+ )
66
+
60
67
endif ()
61
68
62
69
target_compile_definitions (mbed-core
@@ -87,15 +94,6 @@ target_include_directories(mbed-core
87
94
${CMAKE_CURRENT_SOURCE_DIR}
88
95
)
89
96
90
- # We need to generate a "response file" to pass to the C preprocessor because of path length
91
- # limitations on Windows. We set the response file and bind the path to a global property here.
92
- # We query this global property when we set the linker script for the MBED_TARGET being built.
93
- #
94
- # TODO: Remove this and find a more idiomatic way of passing compile definitions to CPP without
95
- # using global properties.
96
- mbed_generate_options_for_linker (${APP_TARGET} LINKER_PREPROCESS_DEFINITIONS )
97
- set_property (GLOBAL PROPERTY COMPILE_DEFS_RESPONSE_FILE ${LINKER_PREPROCESS_DEFINITIONS} )
98
-
99
97
# These targets are made visible here so their source files which
100
98
# are spread in different directories can be referenced and can be linked against
101
99
# by libraries that depend on them.
@@ -143,14 +141,27 @@ endif()
143
141
144
142
#
145
143
# Configures the application
144
+ # Note, this function will be removed in the next revisions
146
145
#
147
146
function (mbed_configure_app_target target )
148
- # Set the language standard to use per target
149
- target_compile_features (${target}
150
- PUBLIC
151
- c_std_11
152
- cxx_std_14
153
- )
147
+ # We need to generate a "response file" to pass to the C preprocessor because of path length
148
+ # limitations on Windows. We set the response file and bind the path to a global property here.
149
+ # We query this global property when we set the linker script for the MBED_TARGET being built.
150
+ #
151
+ # TODO: Remove this and find a more idiomatic way of passing compile definitions to CPP without
152
+ # using global properties.
153
+ mbed_generate_options_for_linker (${target} LINKER_PREPROCESS_DEFINITIONS )
154
+ set_property (GLOBAL PROPERTY COMPILE_DEFS_RESPONSE_FILE ${LINKER_PREPROCESS_DEFINITIONS} )
155
+
156
+ # Gcc Arm requires memap to be set with app name, equally to ARMClang
157
+ # TODO: move this to toolchain and set properly
158
+ if (MBED_TOOLCHAIN STREQUAL "GCC_ARM" )
159
+ message (${target} )
160
+ target_link_options (mbed-core
161
+ INTERFACE
162
+ "-Wl,-Map=${CMAKE_BINARY_DIR} /${target}${CMAKE_EXECUTABLE_SUFFIX} .map"
163
+ )
164
+ endif ()
154
165
endfunction ()
155
166
156
167
#
0 commit comments