summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-20 16:28:06 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-21 10:18:58 +0000
commit0a99b5a1b7325454fe3d1174d44354888aa22012 (patch)
tree9edc1d3cca42c07ae4767ad7ca3b150895ac5295 /configure.ac
parentloplugin:unusedmethods (diff)
downloadcore-0a99b5a1b7325454fe3d1174d44354888aa22012.tar.gz
core-0a99b5a1b7325454fe3d1174d44354888aa22012.zip
When building with clang-cl on Windows, build CLR code with MSVC
...as clang-cl doesn't support the /clr switch. * In configure.ac, capture the MSCV version (that would be used if CC hadn't been overridden to use clang-cl) into MSVC_CXX. * The logic which flags to pass into gb_CObject__command_pattern is coded into the platform-agnostic LinkTarget.mk, so it's too late to try and filter all relevant flags in com_GCC_class.mk, depending on whether a given .cxx file is a normal one built with the normal $CXX or a special /clr one built with $MSVC_CXX. Thus, a new CxxClrObject class had to be introduced that captures this information early. * When building with clang-cl, the generated config_host/config_*.h files contain values suitable for clang-cl, but not for MSVC. But the .cxx files compiled with MSVC happen to include config_global.h, and would fail. Hack around that problem for now by introducing a hard-coded, minimal solenv/clang-cl/config_global.h that is found first when buliding such a CxxClrObject. Needs cleaning-up properly. Change-Id: Iff8aac51c0b4fa906b14503c692640dda0996d33 Reviewed-on: https://gerrit.libreoffice.org/34509 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 16 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 9259c4dec3a7..42bab2e99e76 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3558,25 +3558,35 @@ if test "$_os" = "WINNT"; then
# location, isn't it likely that lots of other things needs changes, too, and just setting CC
# is not enough?
- if test -z "$CC"; then
+ dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
+ dnl needed when building CLR code:
+ if test -z "$MSVC_CXX"; then
if test "$BITNESS_OVERRIDE" = ""; then
if test -f "$VC_PRODUCT_DIR/bin/cl.exe"; then
- CC="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
+ MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
fi
else
if test "$vcexpress" = "Express"; then
if test -f "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"; then
- CC="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
+ MSVC_CXX="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
fi
else
if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then
- CC="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
+ MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
fi
fi
fi
# This gives us a posix path with 8.3 filename restrictions
- CC=`win_short_path_for_make "$CC"`
+ MSVC_CXX=`win_short_path_for_make "$MSVC_CXX"`
+ fi
+
+ if test -z "$CC"; then
+ CC=$MSVC_CXX
+ fi
+ if test "$BITNESS_OVERRIDE" = ""; then
+ dnl since MSVC 2012, default for x86 is -arch:SSE2:
+ MSVC_CXX="$MSVC_CXX -arch:SSE"
fi
if test -n "$CC"; then
@@ -3720,6 +3730,7 @@ AC_SUBST(VCVER)
AC_SUBST(DEVENV)
PathFormat "$MSPDB_PATH"
MSPDB_PATH="$formatted_path"
+AC_SUBST(MSVC_CXX)
AC_SUBST(SHOWINCLUDES_PREFIX)
if test "$_os" = "WINNT"; then