summaryrefslogtreecommitdiff
path: root/solenv/gbuild/ExternalProject.mk
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-10-05 20:36:46 +0200
committerMichael Stahl <mstahl@redhat.com>2012-10-05 21:19:58 +0200
commit51852f04d1971b7f41cee9dbed14d1aa9e05e25f (patch)
tree59710d950fcc10fa6ca8a45e1a50d3cd5017f1de /solenv/gbuild/ExternalProject.mk
parent368e23a3908fcf87a1290ed21da4b57ccf8f3894 (diff)
gbuild: ExternalProject: add use_libraries, use_static_libraries
Change-Id: Idc8b0adf1a9ed26b2e0bec3454fed0ee34e277aa
Diffstat (limited to 'solenv/gbuild/ExternalProject.mk')
-rw-r--r--solenv/gbuild/ExternalProject.mk44
1 files changed, 37 insertions, 7 deletions
diff --git a/solenv/gbuild/ExternalProject.mk b/solenv/gbuild/ExternalProject.mk
index b604d7f0eb14..81081b53ee63 100644
--- a/solenv/gbuild/ExternalProject.mk
+++ b/solenv/gbuild/ExternalProject.mk
@@ -124,13 +124,6 @@ $(call gb_ExternalProject_get_preparation_target,$(1)) : $(call gb_Package_get_t
endef
-# TODO: do we really want to have projects depending on gbuild libraries?
-define gb_ExternalProject_use_static_libraries
-$(foreach lib,$(2),$(call gb_ExternalProject_get_preparation_target,$(1)) : \
- $(call gb_StaticLibrary_get_target,$(lib)))
-
-endef
-
# Make an external project depend on several packages at once
#
# gb_ExternalProject_use_packages external package(s)
@@ -139,4 +132,41 @@ $(foreach package,$(2),$(call gb_ExternalProject_use_package,$(1),$(package)))
endef
+# Make an external project depend on a StaticLibrary
+#
+# Realistically there are some externals that do not have a usable build
+# system, and other externals that do may depend on those.
+#
+# gb_ExternalProject_use_static_libraries external staticlibraries
+define gb_ExternalProject_use_static_libraries
+ifneq (,$$(filter-out $(gb_StaticLibrary_KNOWNLIBS),$(2)))
+$$(eval $$(call gb_Output_info, currently known static libraries are: $(sort $(gb_StaticLibrary_KNOWNLIBS)),ALL))
+$$(eval $$(call gb_Output_error,Cannot link against static library/libraries $$(filter-out $(gb_StaticLibrary_KNOWNLIBS),$(2)). Static libraries must be registered in Repository.mk))
+endif
+
+$(call gb_ExternalProject_get_preparation_target,$(1)) : \
+ $(foreach lib,$(2),$(call gb_StaticLibrary_get_target,$(lib)))
+
+endef
+
+# Make an external project depend on a Library
+#
+# Realistically there are some externals that do not have a usable build
+# system, and other externals that do may depend on those.
+#
+# gb_ExternalProject_use_libraries external libraries
+define gb_ExternalProject_use_libraries
+ifneq (,$$(filter-out $(gb_Library_KNOWNLIBS),$(2)))
+$$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL))
+$$(eval $$(call gb_Output_error,Cannot link against library/libraries $$(filter-out $(gb_Library_KNOWNLIBS),$(2)). Libraries must be registered in Repository.mk))
+endif
+ifneq (,$$(filter $$(gb_MERGEDLIBS),$(2)))
+$$(eval $$(call gb_Output_error,Cannot link against library/libraries $$(filter $$(gb_MERGEDLIBS),$(2)) because they are merged.))
+endif
+
+$(call gb_ExternalProject_get_preparation_target,$(1)) : \
+ $(foreach lib,$(2),$(call gb_Library_get_target,$(lib)))
+
+endef
+
# vim: set noet sw=4 ts=4: