Suppressed hundreds of useless MSVC warnings (can be reenabled setting cmake variable ENABLE_NOISY_WARNINGS to ON). Fixed some of remaining warnings.
This commit is contained in:
8
3rdparty/libjasper/CMakeLists.txt
vendored
8
3rdparty/libjasper/CMakeLists.txt
vendored
@@ -22,8 +22,10 @@ file(GLOB lib_ext_hdrs jasper/*.h)
|
||||
add_library(${JASPER_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
|
||||
|
||||
if(MSVC)
|
||||
string(REPLACE "/W3" "/W0" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
string(REPLACE "/W4" "/W0" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
if(NOT ENABLE_NOISY_WARNINGS)
|
||||
string(REPLACE "/W3" "/W0" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
string(REPLACE "/W4" "/W0" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
add_definitions(-DJAS_WIN_MSVC_BUILD)
|
||||
endif()
|
||||
|
||||
@@ -33,7 +35,7 @@ if(UNIX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-function-declaration -Wno-unused")
|
||||
endif()
|
||||
|
||||
|
5
3rdparty/libtiff/CMakeLists.txt
vendored
5
3rdparty/libtiff/CMakeLists.txt
vendored
@@ -82,8 +82,7 @@ set(lib_srcs
|
||||
|
||||
if(UNIX)
|
||||
list(APPEND lib_srcs tif_unix.c)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-strict-aliasing -Wno-int-to-pointer-cast")
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS)
|
||||
set_source_files_properties(tif_unix.c PROPERTIES COMPILE_FLAGS "-w")
|
||||
endif()
|
||||
endif()
|
||||
@@ -92,7 +91,7 @@ if(WIN32)
|
||||
list(APPEND lib_srcs tif_win32.c)
|
||||
endif(WIN32)
|
||||
|
||||
if(MSVC)
|
||||
if(MSVC AND NOT ENABLE_NOISY_WARNINGS)
|
||||
string(REPLACE "/W4" "/W0" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
string(REPLACE "/W4" "/W0" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
|
2
3rdparty/zlib/CMakeLists.txt
vendored
2
3rdparty/zlib/CMakeLists.txt
vendored
@@ -82,7 +82,7 @@ if(UNIX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
if(MSVC AND NOT ENABLE_NOISY_WARNINGS)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4013")
|
||||
endif()
|
||||
|
||||
|
Reference in New Issue
Block a user