From b13a95c30156c0c9ebf11ceb664acee08a835b2c Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 16 Jun 2022 19:23:35 -0400 Subject: 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. --- docs/markdown/D.md | 4 ++-- docs/yaml/functions/_build_target_base.yaml | 6 ++++-- docs/yaml/functions/declare_dependency.yaml | 6 +++--- test cases/d/13 declare dep/meson.build | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/markdown/D.md b/docs/markdown/D.md index 7ade5c8..03d4047 100644 --- a/docs/markdown/D.md +++ b/docs/markdown/D.md @@ -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/') ``` diff --git a/docs/yaml/functions/_build_target_base.yaml b/docs/yaml/functions/_build_target_base.yaml index 6bce8ef..d299a85 100644 --- a/docs/yaml/functions/_build_target_base.yaml +++ b/docs/yaml/functions/_build_target_base.yaml @@ -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 diff --git a/docs/yaml/functions/declare_dependency.yaml b/docs/yaml/functions/declare_dependency.yaml index 51fde28..7524447 100644 --- a/docs/yaml/functions/declare_dependency.yaml +++ b/docs/yaml/functions/declare_dependency.yaml @@ -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] diff --git a/test cases/d/13 declare dep/meson.build b/test cases/d/13 declare dep/meson.build index 2293934..eef9816 100644 --- a/test cases/d/13 declare dep/meson.build +++ b/test cases/d/13 declare dep/meson.build @@ -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'), ) -- cgit v1.1