summaryrefslogtreecommitdiff
path: root/solenv/gbuild/platform
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-10-02 15:37:40 +0200
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-10-02 17:35:18 +0200
commit064937d0b5f6786e3ec347fdc5b2c771de348ffa (patch)
treed2ddec56fafc2cd8e5a5f29198e0e0165259d473 /solenv/gbuild/platform
parent3c3d7b313424596188a4916a6469d8c3da4019bb (diff)
Avoid C4847 with --with-latest-c++ when compiling CLR
> [build CLR] cli_ure/source/climaker/climaker_emit.cxx > c1xx: error C2220: the following warning is treated as an error > c1xx: warning C4857: C++/CLI mode does not support C++ versions newer than C++20; setting language to /std:c++20 etc., as seen now with at least VS2022 Preview 17.12.0 Preview 2.1 Change-Id: I34d5bca2a81e849ba24b8df5f41ebb12f08a75fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174389 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Tested-by: Jenkins
Diffstat (limited to 'solenv/gbuild/platform')
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk9
1 files changed, 8 insertions, 1 deletions
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 36ce2b1f964b..e915036b54c8 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -263,10 +263,16 @@ gb_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL)
# be suppressed by -wd4857, only by -Wv:18. The warning seems incorrect, because
# using -std:c++17 produces errors about undeclared 'char8_t'. VS2022 doesn't
# have the problem, so drop -Wv:18 when bumping baseline.
+# Similarly, at least VS2022 Preview 17.12.0 Preview 2.1 with --with-latest-c++ emits a "warning
+# C4857: C++/CLI mode does not support C++ versions newer than C++20; setting language to
+# /std:c++20" that cannot be disabled by adding -wd4857, so hardcode a -std:c++20 substitution in
+# that case:
gb_CXXCLRFLAGS := \
$(if $(COM_IS_CLANG), \
$(patsubst -std=%,-std:c++20 -Zc:__cplusplus,$(gb_CXXFLAGS)), \
- $(gb_CXXFLAGS)) \
+ $(if $(filter -std:c++latest,$(CXXFLAGS_CXX11)), \
+ $(patsubst -std:c++latest,-std:c++20,$(gb_CXXFLAGS)), \
+ $(gb_CXXFLAGS))) \
$(gb_LinkTarget_EXCEPTIONFLAGS) \
-AI $(INSTDIR)/$(LIBO_URE_LIB_FOLDER) \
-EHa \
@@ -274,6 +280,7 @@ gb_CXXCLRFLAGS := \
$(if $(filter 16.0,$(VCVER)),-Wv:18) \
-Zc:twoPhase- \
+
ifeq ($(COM_IS_CLANG),TRUE)
gb_CFLAGS += \