Skip to content

Commit 991b02c

Browse files
committed
CMake: Replace mbed_set_language_standard with target_compile_features and remove MBED_TARGET_LABELS variable resetting
1 parent 76ff098 commit 991b02c

File tree

2 files changed

+6
-23
lines changed

2 files changed

+6
-23
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ if(${MBED_TOOLCHAIN_FILE_USED})
6262
mbed_set_printf_lib(mbed-core ${MBED_PRINTF_LIB})
6363
endif()
6464

65-
66-
set(MBED_TARGET_LABELS
67-
${MBED_TARGET_LABELS} CACHE INTERNAL ""
68-
)
69-
7065
target_compile_definitions(mbed-core
7166
INTERFACE
7267
${MBED_TARGET_DEFINITIONS}
@@ -124,7 +119,12 @@ add_subdirectory(cmsis/device/rtos EXCLUDE_FROM_ALL)
124119
# Configures the application
125120
#
126121
function(mbed_configure_app_target target)
127-
mbed_set_language_standard(${target})
122+
# Set the language standard to use per target
123+
target_compile_features(${target}
124+
PUBLIC
125+
c_std_11
126+
cxx_std_14
127+
)
128128
endfunction()
129129

130130
#

tools/cmake/toolchain.cmake

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,6 @@ set(CMAKE_CROSSCOMPILING TRUE)
4646
set(CMAKE_C_COMPILER_WORKS TRUE)
4747
set(CMAKE_CXX_COMPILER_WORKS TRUE)
4848

49-
# Set the language standard to use per target
50-
function(mbed_set_language_standard target)
51-
set_target_properties(${target}
52-
PROPERTIES
53-
C_STANDARD 11
54-
C_STANDARD_REQUIRED YES
55-
C_EXTENSIONS YES
56-
)
57-
58-
set_target_properties(${target}
59-
PROPERTIES
60-
CXX_STANDARD 14
61-
CXX_STANDARD_REQUIRED YES
62-
CXX_EXTENSIONS YES
63-
)
64-
endfunction()
65-
6649
# Clear toolchains options for all languages as Mbed OS uses
6750
# different initialisation options (such as for optimization and debug symbols)
6851
set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "" FORCE)

0 commit comments

Comments
 (0)