path: root/pch
diff options
authorLuboš Luňák <>2019-09-22 20:28:38 +0200
committerLuboš Luňák <>2019-10-04 08:59:13 +0200
commit98dc4ec4957ffa520c9acb21d2477df36496a000 (patch)
treeab76a20e0660911584d91b444b7369d0ef383841 /pch
parent08d02b550a1aee0e109334384c260244d450d6a0 (diff)
support reusing PCH if linktarget has additional reasonable defines
Where reasonable means they are from a list of defines known not to affect the system headers, and so they are safe to differ from how the PCH was built. A bit hackish, but works in practice. Change-Id: Ia00d2e4c56212aca05ba9d47abbb0d253998219f Reviewed-on: Tested-by: Jenkins Reviewed-by: Luboš Luňák <>
Diffstat (limited to 'pch')
1 files changed, 29 insertions, 0 deletions
diff --git a/pch/inc/clangfix.hxx b/pch/inc/clangfix.hxx
new file mode 100644
index 000000000000..9d1c131081b8
--- /dev/null
+++ b/pch/inc/clangfix.hxx
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+ * 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
+ */
+#ifdef __clang__
+// This is a bit lame, but when using -DMACRO that wasn't present when the PCH was built,
+// Clang suddenly subjects it to the -Wunused-macros check, which isn't the case otherwise.
+// And many of these macros are not actually used. So use them here to silence the warnings.
+// See gb_PrecompiledHeader_ignore_flags_system in solenv/gbuild/ .
+#endif // __clang__
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */