summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2011-12-16 19:58:33 +0100
committerMichael Stahl <mstahl@redhat.com>2011-12-19 12:16:03 +0100
commit176e98241a09d5ccf3da59e61931cee9baa333bb (patch)
treeb32ff0bf61e1aa3b50d6e90433ea0788b8febc8e /solenv
parent468fe685e3c58c84bce6d9a48b931dcc21682679 (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). (cherry picked from commit 0ef8beedb1d2ce70e4d5ec7b24afd1711db29f38) Conflicts: solenv/gbuild/Library.mk
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/ComponentTarget.mk3
-rw-r--r--solenv/gbuild/CppunitTest.mk4
-rw-r--r--solenv/gbuild/Library.mk16
-rw-r--r--solenv/gbuild/TargetLocations.mk2
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 82daae1d97a6..631a5537d32e 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,21 +71,27 @@ $(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
+# 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