1# This file provides a macro to disable compiler warnings on source files. 2# 3# usage: silence_warnings(${source_files}) 4 5macro(silence_warnings _sources) 6 if(BORLAND) 7 set_property(SOURCE ${_sources} 8 PROPERTY 9 COMPILE_FLAGS "-w-") 10 else() 11 set_property(SOURCE ${_sources} 12 PROPERTY 13 COMPILE_FLAGS "-w") 14 endif() 15 # Some specific MSVC warnings: 16 if(MSVC) 17 set_property(SOURCE ${_sources} PROPERTY COMPILE_FLAGS 18 "-wd4068" # Unknown pragma 19 ) 20 endif() 21endmacro() 22