mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-12-30 22:10:59 +01:00
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()
|