summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-10-24 13:20:43 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-10-24 13:28:07 +0200
commit04bc75a9b1d5e14c5ec863fd6d0c70d02d5d9da5 (patch)
tree941c5b8b1de7b00abdae1f273f7d59081608add8 /solenv
parent86bef9224e0f10bfc81bc87c0302d9cee0d33dd6 (diff)
Beware gb_CppunitTest_use_library_files plus gb_CppunitTest_use_component
...it causes the library's objects to be loaded twice, causing potential trouble with static data. So introduce gb_Cppunit_set_componentfile, processing the library's source component file into an additional workdir/CppuntiTest/ component file referencing the test library. (This required to drop the gb_Helper_abbreviate_dirs bric-a-brac, as it would do $W replacement into file URLs contained in the resulting .component file.) Change-Id: I57847e549817d25cca53a13effd7d408e0c99f9a
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/ComponentTarget.mk5
-rw-r--r--solenv/gbuild/CppunitTest.mk12
2 files changed, 14 insertions, 3 deletions
diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk
index 5395a4addc8f..225b198ed444 100644
--- a/solenv/gbuild/ComponentTarget.mk
+++ b/solenv/gbuild/ComponentTarget.mk
@@ -28,12 +28,11 @@ gb_ComponentTarget_get_source = $(SRCDIR)/$(1).component
define gb_ComponentTarget__command
$(call gb_Output_announce,$(3),$(true),CMP,1)
$(if $(LIBFILENAME),,$(call gb_Output_error,No LIBFILENAME set at component target: $(1)))
-$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
$(call gb_ExternalExecutable_get_command,xsltproc) --nonet \
--stringparam uri '$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,$(subst \d,$$,$(COMPONENTPREFIX)))$(LIBFILENAME)' \
--stringparam cppu_env $(gb_CPPU_ENV) -o $(1) \
- $(gb_ComponentTarget_XSLTCOMMANDFILE) $(2))
+ $(gb_ComponentTarget_XSLTCOMMANDFILE) $(2)
endef
@@ -44,7 +43,7 @@ $(call gb_ComponentTarget_get_clean_target,%) :
# when a library is renamed, the component file needs to be rebuilt to match.
# hence simply depend on Repository{,Fixes}.mk since the command runs quickly.
-$(call gb_ComponentTarget_get_target,%) : \
+$(call gb_ComponentTarget_get_target,%) $(call gb_ComponentTarget_get_target,CppunitTest/%) : \
$(call gb_ComponentTarget_get_source,%) \
$(SRCDIR)/Repository.mk \
$(SRCDIR)/RepositoryFixes.mk \
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 3c5f11c975da..aa259e35797b 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -242,6 +242,18 @@ $(call gb_CppunitTest_get_target,$(1)) : \
endef
+define gb_CppunitTest_set_componentfile
+$(call gb_ComponentTarget_ComponentTarget,CppunitTest/$(2),\
+ $(call gb_Helper_make_url,$(gb_CppunitTest_DLLDIR))/,\
+ $(call gb_CppunitTest_get_filename,$(1)))
+$(call gb_CppunitTest_get_target,$(1)) : \
+ $(call gb_ComponentTarget_get_target,CppunitTest/$(2))
+$(call gb_CppunitTest_get_clean_target,$(1)) : \
+ $(call gb_ComponentTarget_get_clean_target,CppunitTest/$(2))
+$(call gb_CppunitTest_use_component,$(1),CppunitTest/$(2))
+
+endef
+
# Given a list of component files, filter out those corresponding
# to libraries not built in this configuration.
define gb_CppunitTest__filter_not_built_components