Kaydet (Commit) 04bc75a9 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 86bef922
...@@ -15,6 +15,8 @@ $(eval $(call gb_CppunitTest_add_exception_objects,configmgr_unit, \ ...@@ -15,6 +15,8 @@ $(eval $(call gb_CppunitTest_add_exception_objects,configmgr_unit, \
configmgr/qa/unit/test \ configmgr/qa/unit/test \
)) ))
$(eval $(call gb_CppunitTest_set_componentfile,configmgr_unit,configmgr/source/configmgr))
$(eval $(call gb_CppunitTest_use_library_objects,configmgr_unit,configmgr)) $(eval $(call gb_CppunitTest_use_library_objects,configmgr_unit,configmgr))
$(eval $(call gb_CppunitTest_use_sdk_api,configmgr_unit,)) $(eval $(call gb_CppunitTest_use_sdk_api,configmgr_unit,))
...@@ -37,7 +39,6 @@ $(eval $(call gb_CppunitTest_use_ure,configmgr_unit)) ...@@ -37,7 +39,6 @@ $(eval $(call gb_CppunitTest_use_ure,configmgr_unit))
$(eval $(call gb_CppunitTest_use_configuration,configmgr_unit)) $(eval $(call gb_CppunitTest_use_configuration,configmgr_unit))
$(eval $(call gb_CppunitTest_use_components,configmgr_unit,\ $(eval $(call gb_CppunitTest_use_components,configmgr_unit,\
configmgr/source/configmgr \
i18npool/util/i18npool \ i18npool/util/i18npool \
i18npool/source/search/i18nsearch \ i18npool/source/search/i18nsearch \
sax/source/expatwrap/expwrap \ sax/source/expatwrap/expwrap \
......
...@@ -28,12 +28,11 @@ gb_ComponentTarget_get_source = $(SRCDIR)/$(1).component ...@@ -28,12 +28,11 @@ gb_ComponentTarget_get_source = $(SRCDIR)/$(1).component
define gb_ComponentTarget__command define gb_ComponentTarget__command
$(call gb_Output_announce,$(3),$(true),CMP,1) $(call gb_Output_announce,$(3),$(true),CMP,1)
$(if $(LIBFILENAME),,$(call gb_Output_error,No LIBFILENAME set at component target: $(1))) $(if $(LIBFILENAME),,$(call gb_Output_error,No LIBFILENAME set at component target: $(1)))
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \ mkdir -p $(dir $(1)) && \
$(call gb_ExternalExecutable_get_command,xsltproc) --nonet \ $(call gb_ExternalExecutable_get_command,xsltproc) --nonet \
--stringparam uri '$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,$(subst \d,$$,$(COMPONENTPREFIX)))$(LIBFILENAME)' \ --stringparam uri '$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,$(subst \d,$$,$(COMPONENTPREFIX)))$(LIBFILENAME)' \
--stringparam cppu_env $(gb_CPPU_ENV) -o $(1) \ --stringparam cppu_env $(gb_CPPU_ENV) -o $(1) \
$(gb_ComponentTarget_XSLTCOMMANDFILE) $(2)) $(gb_ComponentTarget_XSLTCOMMANDFILE) $(2)
endef endef
...@@ -44,7 +43,7 @@ $(call gb_ComponentTarget_get_clean_target,%) : ...@@ -44,7 +43,7 @@ $(call gb_ComponentTarget_get_clean_target,%) :
# when a library is renamed, the component file needs to be rebuilt to match. # 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. # 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,%) \ $(call gb_ComponentTarget_get_source,%) \
$(SRCDIR)/Repository.mk \ $(SRCDIR)/Repository.mk \
$(SRCDIR)/RepositoryFixes.mk \ $(SRCDIR)/RepositoryFixes.mk \
......
...@@ -242,6 +242,18 @@ $(call gb_CppunitTest_get_target,$(1)) : \ ...@@ -242,6 +242,18 @@ $(call gb_CppunitTest_get_target,$(1)) : \
endef 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 # Given a list of component files, filter out those corresponding
# to libraries not built in this configuration. # to libraries not built in this configuration.
define gb_CppunitTest__filter_not_built_components define gb_CppunitTest__filter_not_built_components
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
$(eval $(call gb_CppunitTest_CppunitTest,svgio_import_test)) $(eval $(call gb_CppunitTest_CppunitTest,svgio_import_test))
$(eval $(call gb_CppunitTest_set_componentfile,svgio_import_test,svgio/svgio))
$(eval $(call gb_CppunitTest_set_include,svgio_import_test,\ $(eval $(call gb_CppunitTest_set_include,svgio_import_test,\
$$(INCLUDE) \ $$(INCLUDE) \
-I$(SRCDIR)/svgio/inc \ -I$(SRCDIR)/svgio/inc \
...@@ -63,7 +65,6 @@ $(eval $(call gb_CppunitTest_use_components,svgio_import_test,\ ...@@ -63,7 +65,6 @@ $(eval $(call gb_CppunitTest_use_components,svgio_import_test,\
ucb/source/core/ucb1 \ ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \ ucb/source/ucp/file/ucpfile1 \
unotools/util/utl \ unotools/util/utl \
svgio/svgio \
sax/source/expatwrap/expwrap \ sax/source/expatwrap/expwrap \
)) ))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment