summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-09-22 22:08:56 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-10-04 08:59:34 +0200
commitba33189343a622bddb78657bbb111e5f10ba82a4 (patch)
tree552283520b6c72ce3f55fa88809124d26b7ea58c /solenv
parent98dc4ec4957ffa520c9acb21d2477df36496a000 (diff)
add gbuild function for a common PCH and use it in sc/ and sax/
And make it simple to disable the whole feature by setting gb_DISABLE_PCH_REUSE=1, just in case. Also work around a possible BOOST_ALL_NO_LIB mismatch when using the common PCH. Change-Id: I96fd507edf1ada6242ac225026250e5a588d0193 Reviewed-on: https://gerrit.libreoffice.org/79365 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/CppunitTest.mk1
-rw-r--r--solenv/gbuild/Executable.mk1
-rw-r--r--solenv/gbuild/Library.mk1
-rw-r--r--solenv/gbuild/LinkTarget.mk21
-rw-r--r--solenv/gbuild/PrecompiledHeaders.mk7
-rw-r--r--solenv/gbuild/StaticLibrary.mk1
6 files changed, 28 insertions, 4 deletions
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index c44528131b81..f2a267e3e04b 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -446,6 +446,7 @@ gb_CppunitTest_use_package = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$
gb_CppunitTest_use_packages = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_CppunitTest_set_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_CppunitTest_reuse_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
+gb_CppunitTest_use_common_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_CppunitTest_add_sdi_headers = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_CppunitTest_add_cflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_CppunitTest_set_cflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index 7cc0b72d437c..74b011a311b6 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -144,6 +144,7 @@ gb_Executable_use_unpacked = $(call gb_Executable__forward_to_Linktarget,$(0),$(
gb_Executable_add_sdi_headers = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_Executable_set_precompiled_header = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_Executable_reuse_precompiled_header = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
+gb_Executable_use_common_precompiled_header = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_Executable_add_nativeres = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_Executable_set_warnings_not_errors = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_Executable_set_warnings_disabled = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 9fec8ad45c13..9680a7b75de3 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -227,6 +227,7 @@ gb_Library_use_unpacked = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2
gb_Library_add_sdi_headers = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_Library_set_precompiled_header = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_Library_reuse_precompiled_header = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
+gb_Library_use_common_precompiled_header = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_Library_export_objects_list = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_Library_add_nativeres = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_Library_set_nativeres = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index a6deccdad131..e7bf4c5b05cb 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -1586,13 +1586,30 @@ $(call gb_LinkTarget_get_pch_reuse_timestamp,$(4)) : $(call gb_PrecompiledHeader
endef
+
+# call gb_LinkTarget__reuse_precompiled_header_workarounds,linktarget,pchcxxfile,pchtarget,linktargetmakefilename
+define gb_LinkTarget__reuse_precompiled_header_workarounds
+ifeq ($(COM_IS_CLANG),TRUE)
+$(call gb_LinkTarget_add_defs,$(1),-include $(SRCDIR)/pch/inc/clangfix.hxx)
+endif
+$(if $(filter precompiled_system,$(3)), $(call gb_LinkTarget_add_defs,$(1),-DBOOST_ALL_NO_LIB))
+endef
+
# call gb_LinkTarget_reuse_precompiled_header,linktarget,pchcxxfile,,linktargetmakefilename
define gb_LinkTarget_reuse_precompiled_header
ifneq ($(gb_ENABLE_PCH),)
+ifneq ($(gb_DISABLE_PCH_REUSE),)
$(call gb_LinkTarget__reuse_precompiled_header_impl,$(1),$(2),$(notdir $(2)),$(4))
-ifeq ($(COM_IS_CLANG),TRUE)
-$(call gb_LinkTarget_add_defs,$(1),-include $(SRCDIR)/pch/inc/clangfix.hxx)
+$(call gb_LinkTarget__reuse_precompiled_header_workarounds,$(1),$(2),$(notdir $(2)),$(4))
+endif
endif
+
+endef
+
+# call gb_LinkTarget_use_common_precompiled_header,linktarget,,,
+define gb_LinkTarget_use_common_precompiled_header
+ifneq ($(gb_ENABLE_PCH),)
+$(call gb_LinkTarget_reuse_precompiled_header,$(1),pch/inc/pch/precompiled_system,,$(4))
endif
endef
diff --git a/solenv/gbuild/PrecompiledHeaders.mk b/solenv/gbuild/PrecompiledHeaders.mk
index d04059296cad..0da579ef95e5 100644
--- a/solenv/gbuild/PrecompiledHeaders.mk
+++ b/solenv/gbuild/PrecompiledHeaders.mk
@@ -104,7 +104,7 @@ endef
# Specifically, there are 3 kinds:
# - -DXXX_DLLIMPLEMENTATION - they are used only in our headers, should not affect system headers.
# - -DSYSTEM_XXX - they are used only by our code (if at all), should not affect system headers
-# - various configuration defines - they again should only be used by our code and not system headers
+# - various LO configuration defines - they again should only be used by our code and not system headers
# Technically, different compilers handle additional defines like this:
# - GCC
# * It is explicitly allowed to have different macros, as long as they do not affect the PCH.
@@ -126,11 +126,14 @@ endef
# So while this is officially tricky, in practice it seems to work to allow PCH reuse if the linktarget
# has more defines than the PCH was built with, as long as the defines do not affect the PCH.
gb_PrecompiledHeader_ignore_flags_system := \
--DSAX_DLLIMPLEMENTATION \
-DFASTSAX_DLLIMPLEMENTATION \
+-DSAX_DLLIMPLEMENTATION \
+-DSCQAHELPER_DLLIMPLEMENTATION \
-DSYSTEM_EXPAT \
-DSYSTEM_LIBXML \
-DSYSTEM_ZLIB \
+-DDISABLE_CVE_TESTS \
+-DCPPUNIT_PLUGIN_EXPORT='extern "C" SAL_DLLPUBLIC_EXPORT' \
-include $(SRCDIR)/pch/inc/clangfix.hxx \
# Probably also update pch/inc/clangfix.hxx if you extend the list.
diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk
index da916a239d35..b69b9595e976 100644
--- a/solenv/gbuild/StaticLibrary.mk
+++ b/solenv/gbuild/StaticLibrary.mk
@@ -115,6 +115,7 @@ gb_StaticLibrary_use_static_libraries = $(call gb_StaticLibrary__forward_to_Link
gb_StaticLibrary_add_sdi_headers = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_StaticLibrary_set_precompiled_header = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_StaticLibrary_reuse_precompiled_header = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
+gb_StaticLibrary_use_common_precompiled_header = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_StaticLibrary_set_warnings_not_errors = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_StaticLibrary_set_warnings_disabled = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
gb_StaticLibrary_set_external_code = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))