summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2018-01-19 21:23:51 +0100
committerMichael Stahl <mstahl@redhat.com>2018-01-22 20:08:05 +0100
commit61c88ae6945c241f5f2aeb844eeca0776b487132 (patch)
treee36c2dcfd7917a779e17e840071a836bcb944184
parentsw: add an assert wrt. recent bug in SwHTMLParser::SplitAttrTab() (diff)
downloadcore-61c88ae6945c241f5f2aeb844eeca0776b487132.tar.gz
core-61c88ae6945c241f5f2aeb844eeca0776b487132.zip
gbuild: always compile as C++17 with MSVC 2017
The current update MSVC 2017.5 supports fancy new C++ features, but unfortunately in its default C++14 mode it falls over and dies with an internal compiler error as soon as it sees the WeakImplHelper variadic template. In order to work around the ICE, build everything as C++17, which somehow doesn't crash. This causes loads of deprecation warnings about obsolete std::this and badly designed std::that, almost all of them from boost headers, which are well known for following every best practice in the C++ book. Liberally sprinkle macros around to suppress the warnings for now, like we already do with the other million warnings from boost headers. Change-Id: Ia6b6ef5e457b5fe3c8cfe361ba5da39376bb7c4c Reviewed-on: https://gerrit.libreoffice.org/48225 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--desktop/source/app/sofficemain.cxx3
-rw-r--r--filter/Library_svgfilter.mk7
-rw-r--r--sc/Library_sc.mk7
-rw-r--r--sdext/Library_pdfimport.mk6
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk3
5 files changed, 26 insertions, 0 deletions
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index 657614962489..e27b48d8b93a 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -92,6 +92,9 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id,
std::string ini_path = CrashReporter::getIniFileName();
std::ofstream minidump_file(ini_path, std::ios_base::app);
// TODO: moggi: can we avoid this conversion
+#ifdef _MSC_VER
+#pragma warning (disable: 4996)
+#endif
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1;
std::string aPath = conv1.to_bytes(std::wstring(path)) + conv1.to_bytes(std::wstring(id)) + ".dmp";
minidump_file << "DumpFile=" << aPath << "\n";
diff --git a/filter/Library_svgfilter.mk b/filter/Library_svgfilter.mk
index b8e52c73d9fe..e0d8ff37ccce 100644
--- a/filter/Library_svgfilter.mk
+++ b/filter/Library_svgfilter.mk
@@ -29,6 +29,13 @@ $(eval $(call gb_Library_add_defs,svgfilter,\
-DFILTER_DLLIMPLEMENTATION \
))
+ifeq ($(COM),MSC)
+$(eval $(call gb_Library_add_defs,svgfilter,\
+ -D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING \
+ -D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING \
+))
+endif
+
$(eval $(call gb_Library_set_include,svgfilter,\
$$(INCLUDE) \
-I$(SRCDIR)/filter/inc \
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 9e1432c0a8c3..9d04c29f0d3f 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -29,6 +29,13 @@ $(eval $(call gb_Library_add_defs,sc,\
-DSC_INFO_OSVERSION=\"$(OS)\" \
))
+# there is an odd case of this about std::function in dataproviderdlg.cxx that resists more localised suppression
+ifeq ($(COM),MSC)
+$(eval $(call gb_Library_add_cxxflags,sc,\
+ -wd4121 \
+))
+endif
+
$(eval $(call gb_Library_use_custom_headers,sc,\
officecfg/registry \
))
diff --git a/sdext/Library_pdfimport.mk b/sdext/Library_pdfimport.mk
index 854f00c49248..7c11d36e42ba 100644
--- a/sdext/Library_pdfimport.mk
+++ b/sdext/Library_pdfimport.mk
@@ -35,6 +35,12 @@ $(eval $(call gb_Library_use_externals,pdfimport,\
$(if $(filter-out WNT MACOSX,$(OS)),fontconfig) \
))
+ifeq ($(COM),MSC)
+$(eval $(call gb_Library_add_defs,pdfimport, \
+ -D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING \
+))
+endif
+
$(eval $(call gb_Library_add_defs,pdfimport, \
-DBOOST_SPIRIT_USE_OLD_NAMESPACE \
-DBOOST_ALL_NO_LIB \
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 507264e1db89..b276f2d5329e 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -47,6 +47,8 @@ gb_COMPILERDEFS := \
-DBOOST_ERROR_CODE_HEADER_ONLY \
-DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE \
-DBOOST_SYSTEM_NO_DEPRECATED \
+ -D_HAS_AUTO_PTR_ETC \
+ -D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING \
-D_CRT_NON_CONFORMING_SWPRINTFS \
-D_CRT_NONSTDC_NO_DEPRECATE \
-D_CRT_SECURE_NO_DEPRECATE \
@@ -163,6 +165,7 @@ endif
gb_CXXFLAGS := \
-utf-8 \
+ $(if $(filter-out 140,$(VCVER)),-std:c++17) \
-Gd \
-GR \
-Gs \