diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-12-30 00:25:55 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-12-31 13:19:21 +0200 |
commit | 6e7d5a0c61c10f28f761f211f9e33fc63b8a3da5 (patch) | |
tree | 15f34c4abb7e89bc639da60af526c1df5beac967 | |
parent | e9158b477f1cb1ed24d7b87e7efca1c2a293761f (diff) | |
download | meson-6e7d5a0c61c10f28f761f211f9e33fc63b8a3da5.zip meson-6e7d5a0c61c10f28f761f211f9e33fc63b8a3da5.tar.gz meson-6e7d5a0c61c10f28f761f211f9e33fc63b8a3da5.tar.bz2 |
Make D template work even if dub is not available.
-rw-r--r-- | mesonbuild/templates/dlangtemplates.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/mesonbuild/templates/dlangtemplates.py b/mesonbuild/templates/dlangtemplates.py index a3703a8..124634c 100644 --- a/mesonbuild/templates/dlangtemplates.py +++ b/mesonbuild/templates/dlangtemplates.py @@ -88,13 +88,15 @@ test('{test_name}', test_exe) # Make this library usable from the Dlang # build system. dlang_mod = import('dlang') -dlang_mod.generate_dub_file(meson.project_name().to_lower(), meson.source_root(), - name : meson.project_name(), - license: meson.project_license(), - sourceFiles : '{source_file}', - description : 'Meson sample project.', - version : '{version}', -) +if find_program('dub', required: false).found() + dlang_mod.generate_dub_file(meson.project_name().to_lower(), meson.source_root(), + name : meson.project_name(), + license: meson.project_license(), + sourceFiles : '{source_file}', + description : 'Meson sample project.', + version : '{version}', + ) +endif ''' def create_exe_d_sample(project_name, project_version): |