diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-12-16 19:58:33 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2011-12-16 22:07:48 +0100 |
commit | 0ef8beedb1d2ce70e4d5ec7b24afd1711db29f38 (patch) | |
tree | 15c82b480f90aeed26641953b198a43a1a62651a /solenv | |
parent | 268cfdf23ca410d68bc9f7fb03e32a9a603d0e6d (diff) |
gbuild: refactor gb_Library_set_componentfile:
Reverse the dependency: now the component target depends (order-only) on the
library, which should ensure that gb_CppunitTest_add_component can set up
dependencies such that the unit test does not run concurrently with
a library loaded via UNO being overwritten.
Unfortunately this requires introducing another phony dummy library
target, on which the module can depend (because we don't want to register
the component target as a module target).
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/ComponentTarget.mk | 3 | ||||
-rw-r--r-- | solenv/gbuild/CppunitTest.mk | 4 | ||||
-rw-r--r-- | solenv/gbuild/Library.mk | 16 | ||||
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 2 |
4 files changed, 18 insertions, 7 deletions
diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk index 031d118310c5..efe481991a19 100644 --- a/solenv/gbuild/ComponentTarget.mk +++ b/solenv/gbuild/ComponentTarget.mk @@ -58,7 +58,8 @@ $(call gb_ComponentTarget_get_outdir_target,%) : define gb_ComponentTarget_ComponentTarget $(call gb_ComponentTarget_get_target,$(1)) : COMPONENTPREFIX := $(2) $(call gb_ComponentTarget_get_target,$(1)) : LIBFILENAME := $(3) -$(call gb_ComponentTarget_get_outdir_target,$(1)) : $(call gb_ComponentTarget_get_target,$(1)) +$(call gb_ComponentTarget_get_outdir_target,$(1)) : \ + $(call gb_ComponentTarget_get_target,$(1)) $(call gb_Deliver_add_deliverable,$(call gb_ComponentTarget_get_outdir_target,$(1)),$(call gb_ComponentTarget_get_target,$(1)),$(1)) endef diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index aa87be6ede7c..0d8959e0c841 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -153,9 +153,9 @@ endef define gb_CppunitTest_add_component $(call gb_CppunitTest_get_target,$(1)) : \ - $(call gb_ComponentTarget_get_target,$(2)) + $(call gb_ComponentTarget_get_outdir_target,$(2)) $(call gb_CppunitTest_get_target,$(1)) : \ - UNO_SERVICES += $(call gb_ComponentTarget_get_target,$(2)) + UNO_SERVICES += $(call gb_ComponentTarget_get_outdir_target,$(2)) endef diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index 194e0032c396..133496494e01 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -39,6 +39,8 @@ # gb_Library_Library_platform # gb_Library_TARGETS +# doesn't do anything, just used for hooking up component target +.PHONY: $(call gb_Library__get_final_target,%) # EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows .PHONY : $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT) @@ -69,10 +71,11 @@ $(call gb_LinkTarget_set_targettype,$(2),Library) $(call gb_LinkTarget_add_defs,$(2),\ $(gb_Library_DEFS) \ ) +$(call gb_Library__get_final_target,$(1)) : $(call gb_Library_get_target,$(1)) $(call gb_Library_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) $(call gb_Library_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2)) $(call gb_Library_Library_platform,$(1),$(2),$(gb_Library_DLLDIR)/$(call gb_Library_get_dllname,$(1))) -$$(eval $$(call gb_Module_register_target,$(call gb_Library_get_target,$(1)),$(call gb_Library_get_clean_target,$(1)))) +$$(eval $$(call gb_Module_register_target,$(call gb_Library__get_final_target,$(1)),$(call gb_Library_get_clean_target,$(1)))) $(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1)) endef @@ -97,13 +100,18 @@ $(if $(3),,$(call gb_Output_error,gb_Library_set_soversion_script: no script)) $(call gb_Library__set_soversion_script_platform,$(1),$(2),$(3)) endef +# The dependency from workdir component target to outdir library should ensure +# that gb_CppunitTest_add_component can transitively depend on the library. +# But the component target also must be delivered, so a new phony target +# gb_Library__get_final_target has been invented for that purpose... define gb_Library_set_componentfile $(call gb_ComponentTarget_ComponentTarget,$(2),$(call gb_Library__get_componentprefix,$(1)),\ $(call gb_Library_get_runtime_filename,$(if $(MERGELIBS),$(if $(filter $(gb_MERGED_LIBS),$(1)),merged,$(1)),$(1)))) -$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))) : \ +$(call gb_Library__get_final_target,$(1)) : \ $(call gb_ComponentTarget_get_outdir_target,$(2)) -$(call gb_Library_get_clean_target,$(1)) : $(call gb_ComponentTarget_get_clean_target,$(or $(strip $(3)),$(strip $(2)))) - +$(call gb_ComponentTarget_get_target,$(2)) :| $(call gb_Library_get_target,$(1)) +$(call gb_Library_get_clean_target,$(1)) : \ + $(call gb_ComponentTarget_get_clean_target,$(2)) endef gb_Library__get_componentprefix = \ diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index b7a4fde912b5..cbe2ee747596 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -133,6 +133,8 @@ gb_XcuResTarget_get_target = $(WORKDIR)/XcuResTarget/$(1) gb_Zip_get_target = $(WORKDIR)/Zip/$(1).zip gb_Zip_get_final_target = $(WORKDIR)/Zip/$(1).done +gb_Library__get_final_target = $(WORKDIR)/Dummy/$(1) + define gb_Library_get_external_headers_target $(patsubst $(1):%,$(WORKDIR)/ExternalHeaders/Library/%,$(filter $(1):%,$(gb_Library_FILENAMES))) endef |