Skip to content

Commit 0840a29

Browse files
authored
add separate cxx options for gcc (#80)
* add separate cxx options for gcc * remove warning write-strings
1 parent a9fd4a3 commit 0840a29

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tools/cmake/mbed_toolchain.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
121121
set(link_options "")
122122
set(common_options "")
123123
set(c_cxx_compile_options "") # compile options only for C/CXX
124+
set(cxx_compile_options "") # compile options only for CXX
124125
set(asm_compile_options "") # compile options only for ASM
125126

126127
include(toolchains/${MBED_TOOLCHAIN})
@@ -140,7 +141,7 @@ endmacro(list_to_space_separated)
140141

141142
# set toolchain flags with CMake (INIT variables will be picked up on first run)
142143
list_to_space_separated(CMAKE_C_FLAGS_INIT ${common_options} ${c_cxx_compile_options})
143-
set(CMAKE_CXX_FLAGS_INIT ${CMAKE_C_FLAGS_INIT})
144+
list_to_space_separated(CMAKE_CXX_FLAGS_INIT ${common_options} ${c_cxx_compile_options} ${cxx_compile_options})
144145
list_to_space_separated(CMAKE_ASM_FLAGS_INIT ${common_options} ${asm_compile_options})
145146
list_to_space_separated(CMAKE_EXE_LINKER_FLAGS_INIT ${link_options})
146147

tools/cmake/toolchains/GCC_ARM.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ list(APPEND common_options
4343
"-g3"
4444
)
4545

46+
list(APPEND cxx_compile_options
47+
"-Wno-register"
48+
)
49+
4650
# Configure the toolchain to select the selected C library
4751
function(mbed_set_c_lib target lib_type)
4852
if (${lib_type} STREQUAL "small")

0 commit comments

Comments
 (0)