2022-05-21 13:09:05 +00:00
|
|
|
include(RemoveCompileFlag)
|
|
|
|
|
2024-03-19 06:08:54 +00:00
|
|
|
macro(dolphin_disable_warnings _target)
|
|
|
|
get_target_property(_target_cxx_flags ${_target} COMPILE_OPTIONS)
|
|
|
|
if (_target_cxx_flags)
|
|
|
|
set(new_flags "")
|
|
|
|
foreach(flag IN LISTS _target_cxx_flags)
|
|
|
|
# all warning flags start with "/W" or "/w" or "-W" or "-w"
|
|
|
|
if (NOT "${flag}" MATCHES "^[-/][Ww]")
|
|
|
|
list(APPEND new_flags "${flag}")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
set_target_properties(${_target} PROPERTIES COMPILE_OPTIONS "${new_flags}")
|
|
|
|
endif()
|
2022-05-21 13:09:05 +00:00
|
|
|
if (MSVC)
|
|
|
|
target_compile_options(${_target} PRIVATE "/W0")
|
2024-03-19 06:08:54 +00:00
|
|
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
|
|
|
target_compile_options(${_target} PRIVATE "-w")
|
2022-05-21 13:09:05 +00:00
|
|
|
endif()
|
|
|
|
endmacro()
|