add separate cxx options for gcc (#80)

* add separate cxx options for gcc

* remove warning write-strings
pull/15381/head
JojoS 2022-11-05 21:15:02 +01:00 committed by GitHub
parent a9fd4a3f21
commit 0840a295eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -121,6 +121,7 @@ set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
set(link_options "")
set(common_options "")
set(c_cxx_compile_options "") # compile options only for C/CXX
set(cxx_compile_options "") # compile options only for CXX
set(asm_compile_options "") # compile options only for ASM
include(toolchains/${MBED_TOOLCHAIN})
@ -140,7 +141,7 @@ endmacro(list_to_space_separated)
# set toolchain flags with CMake (INIT variables will be picked up on first run)
list_to_space_separated(CMAKE_C_FLAGS_INIT ${common_options} ${c_cxx_compile_options})
set(CMAKE_CXX_FLAGS_INIT ${CMAKE_C_FLAGS_INIT})
list_to_space_separated(CMAKE_CXX_FLAGS_INIT ${common_options} ${c_cxx_compile_options} ${cxx_compile_options})
list_to_space_separated(CMAKE_ASM_FLAGS_INIT ${common_options} ${asm_compile_options})
list_to_space_separated(CMAKE_EXE_LINKER_FLAGS_INIT ${link_options})

View File

@ -43,6 +43,10 @@ list(APPEND common_options
"-g3"
)
list(APPEND cxx_compile_options
"-Wno-register"
)
# Configure the toolchain to select the selected C library
function(mbed_set_c_lib target lib_type)
if (${lib_type} STREQUAL "small")