diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2011-08-24 12:17:31 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2011-08-24 14:23:43 +0100 |
commit | 75fac9839793f73c9833489f1d70bf4136881cbf (patch) | |
tree | 30c20c8b5924f84439e1b3b122cde6b8193831e6 /solenv/gbuild/LinkTarget.mk | |
parent | 9ba447cec165946ed8b9e719c4a9ee318f9b051b (diff) |
Add support for creating merged library.
This commit allows to set which libraries to merge
and creates merged library in tail_build if enabled.
This should save time when loading libraries in application
and also makes more sense for link-time optimization.
Signed-off-by: Michael Meeks <michael.meeks@novell.com>
Diffstat (limited to 'solenv/gbuild/LinkTarget.mk')
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 990f4bedede6..325a37d0ee5b 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -44,6 +44,15 @@ CXXFLAGS ?= $(gb_COMPILEROPTFLAGS) OBJCXXFLAGS ?= $(gb_COMPILEROPTFLAGS) endif +# if enabled we can create one library instead of more smaller +ifeq ($(MERGELIBS),YES) +# list of libraries which are always loaded, thus we can merge them into one +# they have to be from tail_build, so we could link against merged library +gb_CORE_LIBS := \ + uui \ + +endif + # Overview of dependencies and tasks of LinkTarget # # target task depends on @@ -724,11 +733,17 @@ $$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Librar $$(eval $$(call gb_Output_error,Cannot link against library/libraries $$(filter-out $(gb_Library_KNOWNLIBS),$(2)). Libraries must be registered in Repository.mk)) endif -$(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS += $(2) +ifeq ($(MERGELIBS),YES) +gb_LINKED_LIBS := $(if $(filter $(gb_CORE_LIBS),$(2)),merged $(filter-out $(gb_CORE_LIBS),$(2)),$(2)) +else +gb_LINKED_LIBS := $(2) +endif + +$(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS += $$(gb_LINKED_LIBS) -$(call gb_LinkTarget_get_target,$(1)) : $$(foreach lib,$(2),$$(call gb_Library_get_target,$$(lib))) +$(call gb_LinkTarget_get_target,$(1)) : $$(foreach lib,$$(gb_LINKED_LIBS),$$(call gb_Library_get_target,$$(lib))) $(call gb_LinkTarget_get_external_headers_target,$(1)) : \ -$$(foreach lib,$(2),$$(call gb_Library_get_headers_target,$$(lib))) +$$(foreach lib,$$(gb_LINKED_LIBS),$$(call gb_Library_get_headers_target,$$(lib))) endef |