diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-04-07 12:06:19 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-04-11 12:21:08 +0200 |
commit | 3d3826dae92a8bd4671717d92f497db57f6424d1 (patch) | |
tree | d5d1e62cd4ca1db34f340f92fb3613edb007db6d /solenv/gbuild/PrecompiledHeaders.mk | |
parent | merge --enable-selective-debuginfo into --enable-symbols (diff) | |
download | core-3d3826dae92a8bd4671717d92f497db57f6424d1.tar.gz core-3d3826dae92a8bd4671717d92f497db57f6424d1.zip |
fix getting correct debug/nodebug PCH file with selective debuginfo
Since debuginfo enabled/disabled is per-linktarget, the rules need
to be per-linktarget as well, and so instead of one generic rule
there needs to be a define generating one rule per each linktarget.
Change-Id: I9423c4a86bc02aa3c0bf816f47e3c3d43ff03b23
Reviewed-on: https://gerrit.libreoffice.org/70370
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'solenv/gbuild/PrecompiledHeaders.mk')
-rw-r--r-- | solenv/gbuild/PrecompiledHeaders.mk | 65 |
1 files changed, 38 insertions, 27 deletions
diff --git a/solenv/gbuild/PrecompiledHeaders.mk b/solenv/gbuild/PrecompiledHeaders.mk index 2da085512ec2..e5635e816b42 100644 --- a/solenv/gbuild/PrecompiledHeaders.mk +++ b/solenv/gbuild/PrecompiledHeaders.mk @@ -23,42 +23,53 @@ ifeq ($(gb_ENABLE_PCH),$(true)) # Use different PCH file depending on whether we use debugging symbols. -# TODO: This doesn't work because T_SYMBOLS is not expanded as/when necessary. -gb_PrecompiledHeader__get_debugdir := $(if $(filter $(true),$(T_SYMBOLS)),debug,nodebug) +gb_PrecompiledHeader__get_debugdir = $(if $(call gb_LinkTarget__symbols_enabled,$(1)),debug,nodebug) -$(call gb_PrecompiledHeader_get_dep_target,%) : - $(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $@) && \ - echo "$(call gb_PrecompiledHeader_get_target,$*) : $(gb_Helper_PHONY)" > $@) +# IMPORTANT: Since these defines get expanded, every $ needs to be doubled to $$, except +# for $(1)'s and things that are constant. +# The defines are needed to get the right version of gb_PrecompiledHeader__get_debugdir. + +# $(call gb_PrecompiledHeader_generate_rules,pchtarget,linktargetmakefilename) +define gb_PrecompiledHeader_generate_rules + +$(call gb_PrecompiledHeader_get_dep_target,$(1),$(2)) : + $$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $$(dir $$@) && \ + echo "$$(call gb_PrecompiledHeader_get_target,$(1),$(2)) : $$(gb_Helper_PHONY)" > $$@) # despite this being only one .d file, need to run concat-deps on it to # re-write external headers from UnpackedTarball -$(call gb_PrecompiledHeader_get_target,%) : - rm -f $@ - $(call gb_PrecompiledHeader__command,$@,$*,$<,$(PCH_DEFS),$(PCH_CXXFLAGS) $(gb_PrecompiledHeader_EXCEPTIONFLAGS),$(INCLUDE)) - $(SHA256SUM) $@ >$@.sum +$(call gb_PrecompiledHeader_get_target,$(1),$(2)) : + rm -f $$@ + $$(call gb_PrecompiledHeader__command,$$@,$(1),$$<,$$(PCH_DEFS),$$(PCH_CXXFLAGS) $$(gb_PrecompiledHeader_EXCEPTIONFLAGS),$$(INCLUDE),$(2)) + $(SHA256SUM) $$@ >$$@.sum ifeq ($(gb_FULLDEPS),$(true)) - $(call gb_Helper_abbreviate_dirs,\ - RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,$(call gb_PrecompiledHeader_get_dep_target_tmp,$*)) && \ - $(call gb_Executable_get_command,concat-deps) $${RESPONSEFILE} \ - > $(call gb_PrecompiledHeader_get_dep_target,$*) && \ - rm -f $${RESPONSEFILE} $(call gb_PrecompiledHeader_get_dep_target_tmp,$*)) + $$(call gb_Helper_abbreviate_dirs,\ + RESPONSEFILE=$$(call var2file,$$(shell $$(gb_MKTEMP)),200,$$(call gb_PrecompiledHeader_get_dep_target_tmp,$(1),$(2))) && \ + $$(call gb_Executable_get_command,concat-deps) $$$${RESPONSEFILE} \ + > $$(call gb_PrecompiledHeader_get_dep_target,$(1),$(2)) && \ + rm -f $$$${RESPONSEFILE} $$(call gb_PrecompiledHeader_get_dep_target_tmp,$(1),$(2))) endif -.PHONY : $(call gb_PrecompiledHeader_get_clean_target,%) -$(call gb_PrecompiledHeader_get_clean_target,%) : - $(call gb_Output_announce,$*,$(false),PCH,1) - -$(call gb_Helper_abbreviate_dirs,\ - rm -f $(call gb_PrecompiledHeader_get_target,$*) \ - $(call gb_PrecompiledHeader_get_target,$*).obj \ - $(call gb_PrecompiledHeader_get_target,$*).pdb \ - $(call gb_PrecompiledHeader_get_target,$*).sum \ - $(call gb_PrecompiledHeader_get_timestamp,$*) \ - $(call gb_PrecompiledHeader_get_dep_target,$*)) +.PHONY : $(call gb_PrecompiledHeader_get_clean_target,$(1)) +$(call gb_PrecompiledHeader_get_clean_target,$(1)) : + $$(call gb_Output_announce,$(1),$(false),PCH,1) + -$$(call gb_Helper_abbreviate_dirs,\ + rm -f $$(call gb_PrecompiledHeader_get_target,$(1),$(2)) \ + $$(call gb_PrecompiledHeader_get_target,$(1),$(2)).obj \ + $$(call gb_PrecompiledHeader_get_target,$(1),$(2)).pdb \ + $$(call gb_PrecompiledHeader_get_target,$(1),$(2)).sum \ + $$(call gb_PrecompiledHeader_get_timestamp,$(2)) \ + $$(call gb_PrecompiledHeader_get_dep_target,$(1),$(2))) + +endef endif -$(call gb_PrecompiledHeader_get_timestamp,%) : - mkdir -p $(dir $@) && touch $@ +# $(call gb_PrecompiledHeader_generate_timestamp_rule,linktargetmakefilename) +define gb_PrecompiledHeader_generate_timestamp_rule +$(call gb_PrecompiledHeader_get_timestamp,$(1)) : + mkdir -p $$(dir $$@) && touch $$@ +endef # vim: set noet sw=4: |