mirror of https://github.com/ARMmbed/mbed-os.git
CMake: Replace mbed_set_language_standard with target_compile_features and remove MBED_TARGET_LABELS variable resetting
parent
76ff098e94
commit
991b02ca7e
|
@ -62,11 +62,6 @@ if(${MBED_TOOLCHAIN_FILE_USED})
|
|||
mbed_set_printf_lib(mbed-core ${MBED_PRINTF_LIB})
|
||||
endif()
|
||||
|
||||
|
||||
set(MBED_TARGET_LABELS
|
||||
${MBED_TARGET_LABELS} CACHE INTERNAL ""
|
||||
)
|
||||
|
||||
target_compile_definitions(mbed-core
|
||||
INTERFACE
|
||||
${MBED_TARGET_DEFINITIONS}
|
||||
|
@ -124,7 +119,12 @@ add_subdirectory(cmsis/device/rtos EXCLUDE_FROM_ALL)
|
|||
# Configures the application
|
||||
#
|
||||
function(mbed_configure_app_target target)
|
||||
mbed_set_language_standard(${target})
|
||||
# Set the language standard to use per target
|
||||
target_compile_features(${target}
|
||||
PUBLIC
|
||||
c_std_11
|
||||
cxx_std_14
|
||||
)
|
||||
endfunction()
|
||||
|
||||
#
|
||||
|
|
|
@ -46,23 +46,6 @@ set(CMAKE_CROSSCOMPILING TRUE)
|
|||
set(CMAKE_C_COMPILER_WORKS TRUE)
|
||||
set(CMAKE_CXX_COMPILER_WORKS TRUE)
|
||||
|
||||
# Set the language standard to use per target
|
||||
function(mbed_set_language_standard target)
|
||||
set_target_properties(${target}
|
||||
PROPERTIES
|
||||
C_STANDARD 11
|
||||
C_STANDARD_REQUIRED YES
|
||||
C_EXTENSIONS YES
|
||||
)
|
||||
|
||||
set_target_properties(${target}
|
||||
PROPERTIES
|
||||
CXX_STANDARD 14
|
||||
CXX_STANDARD_REQUIRED YES
|
||||
CXX_EXTENSIONS YES
|
||||
)
|
||||
endfunction()
|
||||
|
||||
# Clear toolchains options for all languages as Mbed OS uses
|
||||
# different initialisation options (such as for optimization and debug symbols)
|
||||
set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "" FORCE)
|
||||
|
|
Loading…
Reference in New Issue