From ca2556fb0ee9e8a656774695ed64e8d91e42aa81 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Mon, 8 Jun 2020 10:44:23 -0700 Subject: [PATCH] Fix up windows warnings as errors --- QGCCommon.pri | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/QGCCommon.pri b/QGCCommon.pri index 5820b76..e1b9b36 100644 --- a/QGCCommon.pri +++ b/QGCCommon.pri @@ -84,6 +84,7 @@ linux { DEFINES += QGC_GST_TAISYNC_ENABLED DEFINES += QGC_GST_MICROHARD_ENABLED DEFINES += QGC_ENABLE_MAVLINK_INSPECTOR + DEFINES += _CRT_NO_SECURE_WARNINGS QMAKE_CFLAGS -= -Zc:strictStrings QMAKE_CFLAGS_RELEASE -= -Zc:strictStrings QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings @@ -91,11 +92,19 @@ linux { QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings QMAKE_CXXFLAGS += /std:c++17 - QMAKE_CXXFLAGS_WARN_ON += /WX /W3 \ - /wd4005 \ # silence warnings about macro redefinition, these come from the shapefile code with is external + QMAKE_CXXFLAGS_WARN_ON -= -w34100 # Qt insanity which prevents /wd on 4100 error from working correctly + QMAKE_CXXFLAGS += /W3 \ /wd4290 \ # ignore exception specifications /wd4267 \ # silence conversion from 'size_t' to 'int', possible loss of data, these come from gps drivers shared with px4 /wd4100 # unreferenced formal parameter - gst-plugins-good + QMAKE_CFLAGS += /W3 \ + /wd4005 \ # shape file code + /wd4267 \ # shape file code + /wd4996 # shape file code + !WarningsAsErrorsOff { + QMAKE_CXXFLAGS += /WX + QMAKE_CFLAGS += /WX + } } else { error("Unsupported Windows toolchain, only Visual Studio 2017 64 bit is supported") }