[CMAKE] Get rid of add_compile_flags

Use add_compile_options and the like instead
This commit is contained in:
Jérôme Gardou 2020-09-21 12:16:02 +02:00 committed by Jérôme Gardou
parent 84621b3634
commit 00ed72d7e8
26 changed files with 158 additions and 198 deletions

View file

@ -48,19 +48,3 @@ function(add_target_link_flags _module _flags)
endif()
add_target_property(${_module} LINK_FLAGS ${_flags})
endfunction()
# add_compile_flags
# Add or replace compiler flags in the global scope for either all source
# files or only those of the specified language.
#
# Examples:
# add_compile_flags("-pedantic -O5")
function(add_compile_flags _flags)
if(${ARGC} GREATER 1)
message(FATAL_ERROR "Excess arguments to add_compile_flags! Args ${ARGN}")
endif()
# Adds the compiler flag for all code files: C, C++, and assembly
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${_flags}" PARENT_SCOPE)
endfunction()