Share common code to extract the `variables` kwarg in declare_dependency() and pkg.generate().pull/7859/head
parent
2e80c52129
commit
bcf369ea3c
11 changed files with 58 additions and 31 deletions
@ -0,0 +1,12 @@ |
||||
## Consistency between `declare_dependency()` and `pkgconfig.generate()` variables |
||||
|
||||
The `variables` keyword argument in `declare_dependency()` used to only support |
||||
dictionary and `pkgconfig.generate()` only list of strings. They now both support |
||||
dictionary and list of strings in the format `'name=value'`. This makes easier |
||||
to share a common set of variables for both: |
||||
|
||||
```meson |
||||
vars = {'foo': 'bar'} |
||||
dep = declare_dependency(..., variables: vars) |
||||
pkg.generate(..., variables: vars) |
||||
``` |
@ -1,7 +1,7 @@ |
||||
{ |
||||
"stdout": [ |
||||
{ |
||||
"line": "test cases/failing/47 pkgconfig variables zero length/meson.build:8:5: ERROR: Invalid variable \"=value\". Variables must be in 'name=value' format" |
||||
"line": "test cases/failing/47 pkgconfig variables zero length/meson.build:8:5: ERROR: Empty variable name or value" |
||||
} |
||||
] |
||||
} |
||||
|
@ -1,7 +1,7 @@ |
||||
{ |
||||
"stdout": [ |
||||
{ |
||||
"line": "test cases/failing/48 pkgconfig variables zero length value/meson.build:8:5: ERROR: Invalid variable \"key=\". Variables must be in 'name=value' format" |
||||
"line": "test cases/failing/48 pkgconfig variables zero length value/meson.build:8:5: ERROR: Empty variable name or value" |
||||
} |
||||
] |
||||
} |
||||
|
@ -1,7 +1,7 @@ |
||||
{ |
||||
"stdout": [ |
||||
{ |
||||
"line": "test cases/failing/49 pkgconfig variables not key value/meson.build:8:5: ERROR: Invalid variable \"this_should_be_key_value\". Variables must be in 'name=value' format" |
||||
"line": "test cases/failing/49 pkgconfig variables not key value/meson.build:8:5: ERROR: Variable 'this_should_be_key_value' must have a value separated by equals sign." |
||||
} |
||||
] |
||||
} |
||||
|
Loading…
Reference in new issue