@@ -57,6 +57,13 @@ if(${MBED_TOOLCHAIN_FILE_USED})
5757 mbed_set_profile_options(mbed-core ${MBED_TOOLCHAIN} )
5858 mbed_set_c_lib(mbed-core ${MBED_C_LIB} )
5959 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+
6067endif ()
6168
6269target_compile_definitions (mbed-core
@@ -87,15 +94,6 @@ target_include_directories(mbed-core
8794 ${CMAKE_CURRENT_SOURCE_DIR}
8895)
8996
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-
9997# These targets are made visible here so their source files which
10098# are spread in different directories can be referenced and can be linked against
10199# by libraries that depend on them.
@@ -143,14 +141,27 @@ endif()
143141
144142#
145143# Configures the application
144+ # Note, this function will be removed in the next revisions
146145#
147146function (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 ()
154165endfunction ()
155166
156167#
0 commit comments