2016-07-24 13:55:33 +00:00
|
|
|
# Disables all warnings on MSVC and GNU-compatible compilers.
|
|
|
|
|
|
|
|
function(disable_warnings)
|
2016-07-31 22:51:50 +00:00
|
|
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
2016-07-24 13:55:33 +00:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w" PARENT_SCOPE)
|
2016-07-31 22:51:50 +00:00
|
|
|
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
2016-07-24 13:55:33 +00:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0" PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
|
2016-07-31 22:51:50 +00:00
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
2016-07-24 13:55:33 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w" PARENT_SCOPE)
|
2016-07-31 22:51:50 +00:00
|
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
2016-07-24 13:55:33 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0" PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
endfunction()
|