mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-12-29 05:30:54 +01:00
08b73b8a77
Also make it add flags to both C and C++ when appropriate
15 lines
360 B
CMake
15 lines
360 B
CMake
include(CheckCCompilerFlag)
|
|
include(CheckCXXCompilerFlag)
|
|
|
|
macro(check_and_add_flag var flag)
|
|
check_c_compiler_flag(${flag} FLAG_C_${var})
|
|
if(FLAG_C_${var})
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
|
endif()
|
|
|
|
check_cxx_compiler_flag(${flag} FLAG_CXX_${var})
|
|
if(FLAG_CXX_${var})
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
|
endif()
|
|
endmacro()
|