summaryrefslogtreecommitdiff
path: root/solenv/gbuild
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-01 14:21:17 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-10-01 22:35:24 +0200
commit22267b7797340d1eb52ced10fe05afeb8a42fc2b (patch)
tree7bc44854300246591d6c7e14ed788b7cdf221ae1 /solenv/gbuild
parent5b4a9cd357bf5767e8dde36249f76631d6f4beca (diff)
When building with clang-cl, nevertheless use MSVC's CXXFLAGS_CXX11 for CLR
...which is built with MSVC after all. 0a99b5a1b7325454fe3d1174d44354888aa22012 "When building with clang-cl on Windows, build CLR code with MSVC" had happened to get away with passing a bogus -Xclang -std=... (which cl then ignores) instead of /std:c++17, but nowadays the build fails with things like > [build CLR] cli_ure/source/climaker/climaker_app.cxx [...] > cl : Command line warning D9002 : ignoring unknown option '-Xclang' > cl : Command line warning D9002 : ignoring unknown option '-std=gnu++2a' > string_view is only available with C++17 or later. > include\rtl/stringconcat.hxx(232): error C2429: attribute 'nodiscard' requires compiler flag '/std:c++17' [...] This is a bit of a hack, using hardcoded values for now. Ideally we would capture MSVC's CXXFLAGS_CXX11 in an additional variable in configure.ac, and do a subst from CXXFLAGS_CXX11 to MSVC's CXXFLAGS_CXX11 here. Change-Id: Ifde367c7d1c3db57e75a6ccadc82d534bcb13d0a Reviewed-on: https://gerrit.libreoffice.org/79961 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'solenv/gbuild')
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index f94ce967bced..8a3bda2cb6a2 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -282,7 +282,11 @@ gb_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL)
# When compiling for CLR, disable "warning C4339: use of undefined type detected
# in CLR meta-data - use of this type may lead to a runtime exception":
-gb_CXXCLRFLAGS := $(gb_CXXFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
+gb_CXXCLRFLAGS := \
+ $(if $(COM_IS_CLANG), \
+ $(patsubst -std=%,-std:c++17 -Zc:__cplusplus,$(gb_CXXFLAGS)), \
+ $(gb_CXXFLAGS)) \
+ $(gb_LinkTarget_EXCEPTIONFLAGS) \
-AI $(INSTDIR)/$(LIBO_URE_LIB_FOLDER) \
-EHa \
-clr \