Janitor : Disable deprecated functions for newer Qt5 (#7122)

This commit is contained in:
Magne Sjaastad 2020-12-15 15:54:07 +01:00 committed by GitHub
parent 746385fbce
commit f2c43af8ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -383,16 +383,25 @@ if(MSVC)
# set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "/W3 /wd4190
# /wd4100 /wd4127")
set_target_properties(
ResInsight PROPERTIES COMPILE_FLAGS
"/wd4190 /wd4100 /wd4127 /wd4245 /wd4005")
set(BUILD_FLAGS_FOR_MSVC "/wd4190 /wd4100 /wd4127 /wd4245 /wd4005")
if(Qt5Core_VERSION_STRING GREATER_EQUAL 5.10)
# Disable warning for deprecated functions in newer versions of Qt
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996?view=msvc-160
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4996")
endif()
if(CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 19.14)
# The following warning is generated over 800 times from a qwt header only
# using VS2015 Disabling temporarily warning C4505 'function' : unreferenced
# local function has been removed
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "/wd4505")
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4505")
endif()
message(STATUS "BUILD_FLAGS_FOR_MSVC ${BUILD_FLAGS_FOR_MSVC}")
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS
${BUILD_FLAGS_FOR_MSVC})
endif()
# ##############################################################################