diff options
authorStephan Bergmann <>2019-10-01 14:21:17 +0200
committerStephan Bergmann <>2019-10-01 22:35:24 +0200
commit22267b7797340d1eb52ced10fe05afeb8a42fc2b (patch)
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, and do a subst from CXXFLAGS_CXX11 to MSVC's CXXFLAGS_CXX11 here. Change-Id: Ifde367c7d1c3db57e75a6ccadc82d534bcb13d0a Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
1 files changed, 5 insertions, 1 deletions
diff --git a/solenv/gbuild/platform/ b/solenv/gbuild/platform/
index f94ce967bced..8a3bda2cb6a2 100644
--- a/solenv/gbuild/platform/
+++ b/solenv/gbuild/platform/
@@ -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":
+ $(if $(COM_IS_CLANG), \
+ $(patsubst -std=%,-std:c++17 -Zc:__cplusplus,$(gb_CXXFLAGS)), \
+ $(gb_CXXFLAGS)) \
+ $(gb_LinkTarget_EXCEPTIONFLAGS) \
-EHa \
-clr \