summaryrefslogtreecommitdiff
path: root/solenv/gbuild/gbuild.mk
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-02-07 20:42:40 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-02-10 10:10:46 +0100
commit396d1019413ea6d7e3965e47beae0837d2cf84f2 (patch)
treee391deb3089a354eb82e2a9a6a73f377aee96b71 /solenv/gbuild/gbuild.mk
parent67770fc41f409e9d7e179b34eb84434ed237a6ce (diff)
add BLOCK_PCH to gbuild, allowing partial non-PCH rebuilds
Both MSVC and Clang (with -building-pch-with-obj) generate one extra object file for code from the PCH, saving repeated generating of this code for every object using the PCH. This causes problems when temporarily disabling PCH by doing 'make ENABLE_PCH=' (e.g. when checking #include's are correct), as this object would no longer be linked in, and objects not rebuilt with PCH disabled would still need it. This patch allows doing 'make BLOCK_PCH=1' instead, which will disable PCH with the exception of this object file still getting linked in. Change-Id: I8fcb150ef27ebb34118d62739a1a1558aa1a6f3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88341 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'solenv/gbuild/gbuild.mk')
-rw-r--r--solenv/gbuild/gbuild.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 774bb5adfc8b..94bb0f93e866 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -142,7 +142,14 @@ ifeq ($(gb_ENABLE_SYMBOLS_FOR),no)
gb_ENABLE_SYMBOLS_FOR :=
endif
+ifeq ($(BLOCK_PCH),)
gb_ENABLE_PCH := $(ENABLE_PCH)
+else
+# Setting BLOCK_PCH effectively disables PCH, but the extra object file will be still linked in.
+# This is useful for rebuilding only some files with PCH disabled, e.g. to check #include's,
+# disabling the whole ENABLE_PCH would lead to unresolved symbols at link time.
+gb_ENABLE_PCH :=
+endif
ifneq ($(nodep)$(ENABLE_PRINT_DEPS),)
gb_FULLDEPS := $(false)