docs: d_module_versions has an undocumented ability to accept integers

Dlang uses both integer version "levels" and arbitrary string
identifiers, and we support both, but don't mention it in the docs.

Also update a test case to pass one via declare_dependency. We already
test this kwarg for build_target.
pull/10495/head
Eli Schwartz 2 years ago
parent e99e55d0aa
commit b13a95c301
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 4
      docs/markdown/D.md
  2. 6
      docs/yaml/functions/_build_target_base.yaml
  3. 6
      docs/yaml/functions/declare_dependency.yaml
  4. 2
      test cases/d/13 declare dep/meson.build

@ -95,7 +95,7 @@ my_lib = library('mylib',
install: true,
version: meson.project_version(),
soversion: project_soversion,
d_module_versions: ['FeatureA', 'featureB']
d_module_versions: ['FeatureA', 'featureB', 1]
)
pkgc = import('pkgconfig')
@ -104,7 +104,7 @@ pkgc.generate(name: 'mylib',
subdirs: 'd/mylib',
version: meson.project_version(),
description: 'A simple example D library.',
d_module_versions: ['FeatureA']
d_module_versions: ['FeatureA', 1]
)
install_subdir('src/mylib/', install_dir: 'include/d/mylib/')
```

@ -253,12 +253,14 @@ kwargs:
description: When set to true, the D modules are compiled in debug mode.
d_module_versions:
type: list[str]
type: list[str | int]
description: List of module version identifiers set when compiling D sources.
d_debug:
type: list[str]
description: List of module debug identifiers set when compiling D sources.
description: |
The [D version identifiers](https://dlang.org/spec/version.html#version) to add
during the compilation of D source files.
native:
type: bool

@ -59,11 +59,11 @@ kwargs:
pkg-config. *since 0.56.0* it can also be a list of `'key=value'` strings.
d_module_versions:
type: str | list[str]
type: str | int | list[str | int]
since: 0.62.0
description: |
a string or a list of strings,
the D versions to add during the compilation of D source files
The [D version identifiers](https://dlang.org/spec/version.html#version) to add
during the compilation of D source files.
d_import_dirs:
type: list[inc | str]

@ -3,7 +3,7 @@ project('meson-d-sample', 'd',
)
my_dep = declare_dependency(
d_module_versions: ['TestVersion'],
d_module_versions: ['TestVersion', 1],
d_import_dirs: include_directories('views'),
)

Loading…
Cancel
Save