aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-01-07 11:28:00 -0800
committerDylan Baker <dylan@pnwbakers.com>2020-01-09 11:02:17 -0800
commitcd895be99a7917e8c052ec7bb6088704c87783ae (patch)
tree37710d4c905fa0d22c27b37d92d36908554109e5 /test cases
parentff822990d1af6ff6c6f7ae3f2efa9012d4b14bf9 (diff)
downloadmeson-cd895be99a7917e8c052ec7bb6088704c87783ae.zip
meson-cd895be99a7917e8c052ec7bb6088704c87783ae.tar.gz
meson-cd895be99a7917e8c052ec7bb6088704c87783ae.tar.bz2
dependencies: Add ability to set arbitrary variables on
declare_dependencies This allows dependencies declared in subprojects to set variables, and for those variables to be accessed via the get_variable method, just like those from pkg-config and cmake. This makes it easier to use projects from subprojects in a polymorphic manner, lowering the distinction between a subproject and an external dependency every further.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/218 dependency get_variable method/meson.build13
1 files changed, 11 insertions, 2 deletions
diff --git a/test cases/common/218 dependency get_variable method/meson.build b/test cases/common/218 dependency get_variable method/meson.build
index 72e65ee..8c189bb 100644
--- a/test cases/common/218 dependency get_variable method/meson.build
+++ b/test cases/common/218 dependency get_variable method/meson.build
@@ -47,6 +47,15 @@ else
'cmake config-tool got default when we shouldn\'t have.')
endif
+idep = declare_dependency(variables : {'foo' : 'value'})
+assert(idep.get_variable(pkgconfig : 'foo', cmake : 'foo', configtool : 'foo',
+ internal : 'foo', default_value : default) == 'value',
+ 'internal got default when it shouldn\'t have.')
+assert(idep.get_variable(pkgconfig : 'foo', cmake : 'foo', configtool : 'foo',
+ internal : 'bar', default_value : default) == default,
+ 'internal didn\'t default when it should have.')
+
idep = declare_dependency()
-assert(idep.get_variable(pkgconfig : 'foo', cmake : 'foo', configtool : 'foo', default_value : default) == default,
- 'Got something other than default from an internal dependency')
+assert(idep.get_variable(pkgconfig : 'foo', cmake : 'foo', configtool : 'foo',
+ default_value : default) == default,
+ 'something went wrong with an InternalDependency with no variables.')