From 0a99b5a1b7325454fe3d1174d44354888aa22012 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 20 Feb 2017 16:28:06 +0100 Subject: 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 Reviewed-by: Stephan Bergmann --- solenv/clang-cl/config_global.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 solenv/clang-cl/config_global.h (limited to 'solenv/clang-cl') diff --git a/solenv/clang-cl/config_global.h b/solenv/clang-cl/config_global.h new file mode 100755 index 000000000000..80120f1d2a08 --- /dev/null +++ b/solenv/clang-cl/config_global.h @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +/* A partial copy of config_host/config_global.h.in, with hardcoded values that + suffice to compile CxxClr code in cli_ure/ with MSVC when building the rest + with clang-cl. A bad hack, should be replaced with a better copy that is + actually filled in by configure. +*/ + +#ifndef CONFIG_GLOBAL_H +#define CONFIG_GLOBAL_H + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ -- cgit