aboutsummaryrefslogtreecommitdiff
path: root/test cases/unit/20 subproj dep variables
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-12-28 06:28:35 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-01-01 01:14:03 +0530
commit851475db9b8772930276a29320a14714d3a4da92 (patch)
tree9adb16e9b7577fdb262c8729d52255cccec0abce /test cases/unit/20 subproj dep variables
parentdd3f49af0d8c94033e6db68b25c23ea9e63e9c5c (diff)
downloadmeson-851475db9b8772930276a29320a14714d3a4da92.zip
meson-851475db9b8772930276a29320a14714d3a4da92.tar.gz
meson-851475db9b8772930276a29320a14714d3a4da92.tar.bz2
intrp: Consolidate subproject dep checking and logging
If a dep is not found on the system and a fallback is specified, we have two cases: 1. Look for the dependency in a pre-initialized subproject 2. Initialize the subproject and look for the dependency Both these require version comparing, ensuring the fetched variable is a dependency, and printing a success message, erroring out, etc. Now we share the relevant code instead of duplicating it. It already diverged, so this is a good thing. As a side-effect, we now log fallback dependencies in the same format as system dependencies: Dependency libva found: YES Dependency libva found: YES (cached) Dependency glib-2.0 from subproject subprojects/glib found: YES Dependency glib-2.0 from subproject subprojects/glib found: YES (cached)
Diffstat (limited to 'test cases/unit/20 subproj dep variables')
-rw-r--r--test cases/unit/20 subproj dep variables/meson.build13
-rw-r--r--test cases/unit/20 subproj dep variables/subprojects/failingsubproj/meson.build3
-rw-r--r--test cases/unit/20 subproj dep variables/subprojects/somesubproj/meson.build3
3 files changed, 19 insertions, 0 deletions
diff --git a/test cases/unit/20 subproj dep variables/meson.build b/test cases/unit/20 subproj dep variables/meson.build
new file mode 100644
index 0000000..f1622f9
--- /dev/null
+++ b/test cases/unit/20 subproj dep variables/meson.build
@@ -0,0 +1,13 @@
+project('subproj found dep not found', 'c')
+
+dependency('somedep', required : false,
+ fallback : ['nosubproj', 'dep_name'])
+
+dependency('somedep', required : false,
+ fallback : ['failingsubproj', 'dep_name'])
+
+dependency('somenotfounddep', required : false,
+ fallback : ['somesubproj', 'dep_name'])
+
+dependency('zlibproxy', required : true,
+ fallback : ['somesubproj', 'zlibproxy_dep'])
diff --git a/test cases/unit/20 subproj dep variables/subprojects/failingsubproj/meson.build b/test cases/unit/20 subproj dep variables/subprojects/failingsubproj/meson.build
new file mode 100644
index 0000000..3a84bd2
--- /dev/null
+++ b/test cases/unit/20 subproj dep variables/subprojects/failingsubproj/meson.build
@@ -0,0 +1,3 @@
+project('failingsubproj', 'c')
+
+dep_name = declare_dependency('arg')
diff --git a/test cases/unit/20 subproj dep variables/subprojects/somesubproj/meson.build b/test cases/unit/20 subproj dep variables/subprojects/somesubproj/meson.build
new file mode 100644
index 0000000..dd65c99
--- /dev/null
+++ b/test cases/unit/20 subproj dep variables/subprojects/somesubproj/meson.build
@@ -0,0 +1,3 @@
+project('dep', 'c')
+
+zlibproxy_dep = declare_dependency(dependencies : dependency('zlib', required : false))