| 1 |
include_guard(GLOBAL) |
| 2 |
|
| 3 |
function(disable_warnings) |
| 4 |
set(SOURCES ${ARGN}) |
| 5 |
|
| 6 |
foreach(FILE IN LISTS SOURCES) |
| 7 |
if(MSVC) |
| 8 |
# Annoyingly if you disable all warnings (/w) in combination with enabling |
| 9 |
# some warnings, which we and/or CMake inevitably do, this causes a |
| 10 |
# meta-warning D9025, so instead we have to individually disable them: |
| 11 |
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS |
| 12 |
"/wd4131 /wd4245 /wd4100 /wd4127 /wd4244 /wd4310 /wd4457 /wd4456 /wd4701 /wd4305 /wd4189 /wd4232") |
| 13 |
else() |
| 14 |
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS -w) |
| 15 |
endif() |
| 16 |
endforeach() |
| 17 |
endfunction() |