summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-11-02 16:16:21 +0100
committerMichael Stahl <mstahl@redhat.com>2013-11-02 22:24:12 +0100
commit35210e2272081cef47ec63cca933e0c55424e6cb (patch)
tree1b1e26f3a023e1489da799af3176f584c5bf1fb6 /solenv
parentd800a25568643fd1c7fb634cc9fbfcbd255d6162 (diff)
gbuild: LinkTarget: improve gb_LinkTarget__get_headers_check
Can actually error out early in some cases of partial build with missing deps from other modules; probably better than trying to build (Static)Library with bogus vars. Change-Id: I4e2cbd42d3c84b9bc87607d263f3d80ba7914302
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/LinkTarget.mk19
1 files changed, 19 insertions, 0 deletions
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index d804824c72cb..8e7e002f19d5 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -815,6 +815,14 @@ define gb_PrintDeps_info
$(info LibraryDep: $(1) links against $(2))
endef
+# avoid problem when a module is built partially but other modules that define
+# needed libraries is not yet built: prevent invocation of pattern rule
+# for library with invalid parameters by depending on the header target
+define gb_LinkTarget__lib_dummy_depend
+$(call gb_Library_get_target,$(1)) :| $(call gb_Library_get_headers_target,$(1))
+
+endef
+
# call gb_LinkTarget__use_libraries,linktarget,requestedlibs,actuallibs,linktargetmakefilename
define gb_LinkTarget__use_libraries
@@ -834,6 +842,7 @@ $(call gb_LinkTarget_get_target,$(1)) : \
$(foreach lib,$(3),$(call gb_Library_get_exports_target,$(lib)))
$(call gb_LinkTarget_get_headers_target,$(1)) : \
$(foreach lib,$(2),$(call gb_Library_get_headers_target,$(lib)))
+$(foreach lib,$(2),$(call gb_LinkTarget__lib_dummy_depend,$(lib)))
endef
@@ -894,6 +903,15 @@ $$(call gb_Output_error,\
gb_LinkTarget_add_linked_static_libs: use gb_LinkTarget_use_static_libraries instead.)
endef
+# avoid problem when a module is built partially but other modules that define
+# needed static libraries is not yet built: prevent invocation of pattern rule
+# for static library with invalid parameters by depending on the header target
+define gb_LinkTarget__static_lib_dummy_depend
+$(call gb_StaticLibrary_get_target,$(1)) :| \
+ $(call gb_StaticLibrary_get_headers_target,$(1))
+
+endef
+
# for a StaticLibrary, dependent libraries are not actually linked in
# call gb_LinkTarget_use_static_libraries,linktarget,staticlibs
define gb_LinkTarget_use_static_libraries
@@ -902,6 +920,7 @@ $(call gb_LinkTarget_get_target,$(1)) : LINKED_STATIC_LIBS += $$(if $$(filter-ou
$(call gb_LinkTarget_get_target,$(1)) : $(foreach lib,$(2),$(call gb_StaticLibrary_get_target,$(lib)))
$(call gb_LinkTarget_get_headers_target,$(1)) : \
$(foreach lib,$(2),$(call gb_StaticLibrary_get_headers_target,$(lib)))
+$(foreach lib,$(2),$(call gb_LinkTarget__static_lib_dummy_depend,$(lib)))
endef