aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-04-08 01:08:51 +0300
committerGitHub <noreply@github.com>2018-04-08 01:08:51 +0300
commitd6e71d0c566416c0ba940323c6f2734695c999d0 (patch)
treef87bf2eddd51f69213419b117162274725c480a9 /mesonbuild
parent09dd9e20df33c2ce91ec3304df6ad3909147987b (diff)
parent1105ba3afdf2f533782c5cc5ee984745989a1914 (diff)
downloadmeson-d6e71d0c566416c0ba940323c6f2734695c999d0.zip
meson-d6e71d0c566416c0ba940323c6f2734695c999d0.tar.gz
meson-d6e71d0c566416c0ba940323c6f2734695c999d0.tar.bz2
Merge pull request #3312 from MathieuDuponchelle/alwaysfallback
new wrap-mode: forcefallback
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter.py11
-rw-r--r--mesonbuild/wrap/__init__.py7
2 files changed, 13 insertions, 5 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index e973c1e..b04d586 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -2404,10 +2404,13 @@ to directly access options of other subprojects.''')
dep = None
# Search for it outside the project
- try:
- dep = dependencies.find_external_dependency(name, self.environment, kwargs)
- except DependencyException as e:
- exception = e
+ if self.coredata.wrap_mode != WrapMode.forcefallback or 'fallback' not in kwargs:
+ try:
+ dep = dependencies.find_external_dependency(name, self.environment, kwargs)
+ except DependencyException as e:
+ exception = e
+ else:
+ exception = DependencyException("fallback for %s not found" % name)
# Search inside the projects list
if not dep or not dep.found():
diff --git a/mesonbuild/wrap/__init__.py b/mesonbuild/wrap/__init__.py
index 019634c..6e2bc83 100644
--- a/mesonbuild/wrap/__init__.py
+++ b/mesonbuild/wrap/__init__.py
@@ -25,7 +25,12 @@ from enum import Enum
# to use 'nofallback' so that any 'copylib' wraps will be
# download as subprojects.
#
+# --wrap-mode=forcefallback will ignore external dependencies,
+# even if they match the version requirements, and automatically
+# use the fallback if one was provided. This is useful for example
+# to make sure a project builds when using the fallbacks.
+#
# Note that these options do not affect subprojects that
# are git submodules since those are only usable in git
# repositories, and you almost always want to download them.
-WrapMode = Enum('WrapMode', 'default nofallback nodownload')
+WrapMode = Enum('WrapMode', 'default nofallback nodownload forcefallback')