| 1 |
include(RemoveCompileFlag) |
| 2 |
|
| 3 |
macro(dolphin_disable_warnings _target) |
| 4 |
get_target_property(_target_cxx_flags ${_target} COMPILE_OPTIONS) |
| 5 |
if (_target_cxx_flags) |
| 6 |
set(new_flags "") |
| 7 |
foreach(flag IN LISTS _target_cxx_flags) |
| 8 |
# all warning flags start with "/W" or "/w" or "-W" or "-w" |
| 9 |
if (NOT "${flag}" MATCHES "^[-/][Ww]") |
| 10 |
list(APPEND new_flags "${flag}") |
| 11 |
endif() |
| 12 |
endforeach() |
| 13 |
set_target_properties(${_target} PROPERTIES COMPILE_OPTIONS "${new_flags}") |
| 14 |
endif() |
| 15 |
if (MSVC) |
| 16 |
target_compile_options(${_target} PRIVATE "/W0") |
| 17 |
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") |
| 18 |
target_compile_options(${_target} PRIVATE "-w") |
| 19 |
endif() |
| 20 |
endmacro() |