aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-04-07 08:32:40 -0400
committerXavier Claessens <xclaesse@gmail.com>2021-05-18 18:03:37 -0400
commit69a5c950a3a70fe2e31a8a35f0be51ded89c4937 (patch)
tree441663102e2f40a613a4384d451487e240ff5d1a /docs
parent2a0c2e51373e3e8aa1d4b7eb7f707f826f26f1ef (diff)
downloadmeson-69a5c950a3a70fe2e31a8a35f0be51ded89c4937.zip
meson-69a5c950a3a70fe2e31a8a35f0be51ded89c4937.tar.gz
meson-69a5c950a3a70fe2e31a8a35f0be51ded89c4937.tar.bz2
pkgconfig: Do not escape custom variables
We need to escape space in variables that gets into cflags or libs because otherwise we cannot split compiler args when paths contains spaces. But custom variables are unlikely to be path that gets used in cflags/libs, and escaping them cause regression in GStreamer that use space as separator in a list variable.
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Pkgconfig-module.md12
-rw-r--r--docs/markdown/snippets/pkgconfig_var_escaping.md23
2 files changed, 33 insertions, 2 deletions
diff --git a/docs/markdown/Pkgconfig-module.md b/docs/markdown/Pkgconfig-module.md
index 9c66b33..0d1e859 100644
--- a/docs/markdown/Pkgconfig-module.md
+++ b/docs/markdown/Pkgconfig-module.md
@@ -55,12 +55,20 @@ keyword arguments.
`includedir` are reserved and may not be used. *Since 0.56.0* it can also be a
dictionary but ordering of Meson dictionaries are not guaranteed, which could
cause issues when some variables reference other variables.
+ Spaces in values are escaped with `\`, this is required in the case the value is
+ a path that and is used in `cflags` or `libs` arguments. *Since 0.59.0* if
+ escaping is not desired (e.g. space separate list of values) `unescaped_variables`
+ keyword argument should be used instead.
+- `uninstalled_variables` used instead of the `variables` keyword argument, when
+ generating the uninstalled pkg-config file. Since *0.54.0*
+ Spaces in values are escaped with `\`, this is required in the case the value is
+ a path that and is used in `cflags` or `libs` arguments. *Since 0.59.0* if
+ escaping is not desired (e.g. space separate list of values)
+ `unescaped_uninstalled_variables` keyword argument should be used instead.
- `version` a string describing the version of this library, used to set the
`Version:` field. (*since 0.46.0*) Defaults to the project version if unspecified.
- `d_module_versions` a list of module version flags used when compiling
D sources referred to by this pkg-config file
-- `uninstalled_variables` used instead of the `variables` keyword argument, when
- generating the uninstalled pkg-config file. Since *0.54.0*
- `dataonly` field. (*since 0.54.0*) this is used for architecture-independent
pkg-config files in projects which also have architecture-dependent outputs.
- `conflicts` (*since 0.36.0, incorrectly issued a warning prior to 0.54.0*) list of strings to be put in the `Conflicts` field.
diff --git a/docs/markdown/snippets/pkgconfig_var_escaping.md b/docs/markdown/snippets/pkgconfig_var_escaping.md
new file mode 100644
index 0000000..de0ee96
--- /dev/null
+++ b/docs/markdown/snippets/pkgconfig_var_escaping.md
@@ -0,0 +1,23 @@
+## Unescaped variables in pkgconfig files
+
+Spaces in variable values are escaped with `\`, this is required in the case the
+value is a path that and is used in `cflags` or `libs` arguments. This was an
+undocumented behaviour that caused issues in the case the variable is a space
+separated list of items.
+
+For backward compatibility reasons this behaviour could not be changed, new
+keyword arguments have thus been added: `unescaped_variables` and
+`unescaped_uninstalled_variables`.
+
+```meson
+pkg = import('pkgconfig')
+...
+pkg.generate(lib,
+ variables: {
+ 'mypath': '/path/with spaces/are/escaped',
+ },
+ unescaped_variables: {
+ 'mylist': 'Hello World Is Not Escaped',
+ },
+)
+```