Changeset View
Changeset View
Standalone View
Standalone View
cmake/modules/AddCompilerFlags.cmake
Show All 32 Lines | macro(add_cxx_compiler_flags) | ||||
add_compiler_flags_for_language(CXX ${ARGN}) | add_compiler_flags_for_language(CXX ${ARGN}) | ||||
endmacro() | endmacro() | ||||
macro(add_compiler_flags) | macro(add_compiler_flags) | ||||
add_c_compiler_flags(${ARGN}) | add_c_compiler_flags(${ARGN}) | ||||
add_cxx_compiler_flags(${ARGN}) | add_cxx_compiler_flags(${ARGN}) | ||||
endmacro() | endmacro() | ||||
function(add_compiler_flag_group_for_language LANGUAGE) | |||||
check_compiler_flags(FLAG_GROUP_IS_SUPPORTED ${LANGUAGE} ${ARGN}) | |||||
if(${FLAG_GROUP_IS_SUPPORTED}) | |||||
add_compile_options("$<$<COMPILE_LANGUAGE:${LANGUAGE}>:${ARGN}>") | |||||
endif() | |||||
endfunction() | |||||
macro(add_c_compiler_flag_group) | |||||
add_compiler_flag_group_for_language(C ${ARGN}) | |||||
endmacro() | |||||
macro(add_cxx_compiler_flag_group) | |||||
add_compiler_flag_group_for_language(CXX ${ARGN}) | |||||
endmacro() | |||||
macro(add_compiler_flag_group) | |||||
add_c_compiler_flag_group(${ARGN}) | |||||
add_cxx_compiler_flag_group(${ARGN}) | |||||
endmacro() | |||||
macro(remove_compiler_flags_from_var TARGET) | macro(remove_compiler_flags_from_var TARGET) | ||||
foreach(f ${ARGN}) | foreach(f ${ARGN}) | ||||
string(REGEX REPLACE "${f}( |$)" "" ${TARGET} "${${TARGET}}") | string(REGEX REPLACE "${f}( |$)" "" ${TARGET} "${${TARGET}}") | ||||
endforeach() | endforeach() | ||||
endmacro() | endmacro() | ||||
function(remove_c_compiler_flags) | function(remove_c_compiler_flags) | ||||
remove_compiler_flags_from_var(CMAKE_C_FLAGS ${ARGN}) | remove_compiler_flags_from_var(CMAKE_C_FLAGS ${ARGN}) | ||||
▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines |