d: Make feature names less verbose

pull/2263/head
Matthias Klumpp 7 years ago
parent 75fdf413e4
commit 61db415d7f
  1. 12
      mesonbuild/build.py
  2. 6
      mesonbuild/interpreter.py
  3. 4
      mesonbuild/modules/pkgconfig.py
  4. 12
      test cases/d/9 features/meson.build

@ -36,9 +36,9 @@ known_basic_kwargs = {'install': True,
'vala_args': True,
'fortran_args': True,
'd_args': True,
'd_feature_import_dirs': True,
'd_feature_unittest': True,
'd_feature_versions': True,
'd_import_dirs': True,
'd_unittest': True,
'd_module_versions': True,
'java_args': True,
'rust_args': True,
'link_args': True,
@ -676,13 +676,13 @@ class BuildTarget(Target):
dlist = stringlistify(kwargs.get('d_args', []))
self.add_compiler_args('d', dlist)
dfeatures = dict()
dfeature_unittest = kwargs.get('d_feature_unittest', False)
dfeature_unittest = kwargs.get('d_unittest', False)
if dfeature_unittest:
dfeatures['unittest'] = dfeature_unittest
dfeature_versions = kwargs.get('d_feature_versions', None)
dfeature_versions = kwargs.get('d_module_versions', None)
if dfeature_versions:
dfeatures['versions'] = dfeature_versions
dfeature_import_dirs = kwargs.get('d_feature_import_dirs', None)
dfeature_import_dirs = kwargs.get('d_import_dirs', None)
if dfeature_import_dirs:
dfeatures['import_dirs'] = dfeature_import_dirs
if dfeatures:

@ -1252,9 +1252,9 @@ pch_kwargs = set(['c_pch', 'cpp_pch'])
lang_arg_kwargs = set(['c_args',
'cpp_args',
'd_args',
'd_feature_import_dirs',
'd_feature_unittest',
'd_feature_versions',
'd_import_dirs',
'd_unittest',
'd_module_versions',
'fortran_args',
'java_args',
'objc_args',

@ -121,7 +121,7 @@ class PkgConfigModule(ExtensionModule):
@permittedKwargs({'libraries', 'version', 'name', 'description', 'filebase',
'subdirs', 'requires', 'requires_private', 'libraries_private',
'install_dir', 'extra_cflags', 'variables', 'url', 'd_feature_versions'})
'install_dir', 'extra_cflags', 'variables', 'url', 'd_module_versions'})
def generate(self, state, args, kwargs):
if len(args) > 0:
raise mesonlib.MesonException('Pkgconfig_gen takes no positional arguments.')
@ -148,7 +148,7 @@ class PkgConfigModule(ExtensionModule):
conflicts = mesonlib.stringlistify(kwargs.get('conflicts', []))
extra_cflags = mesonlib.stringlistify(kwargs.get('extra_cflags', []))
dversions = kwargs.get('d_feature_versions', None)
dversions = kwargs.get('d_module_versions', None)
if dversions:
compiler = state.environment.coredata.compilers.get('d')
if compiler:

@ -5,7 +5,7 @@ data_dir = join_paths(meson.current_source_dir(), 'data')
e_plain = executable('dapp_menu',
'app.d',
d_feature_import_dirs: [data_dir]
d_import_dirs: [data_dir]
)
test('dapp_menu_t_fail', e_plain, should_fail: true)
test('dapp_menu_t', e_plain, args: ['menu'])
@ -13,8 +13,8 @@ test('dapp_menu_t', e_plain, args: ['menu'])
# test feature versions and string imports
e_versions = executable('dapp_versions',
'app.d',
d_feature_import_dirs: [data_dir],
d_feature_versions: ['No_Menu', 'With_People']
d_import_dirs: [data_dir],
d_module_versions: ['No_Menu', 'With_People']
)
test('dapp_versions_t_fail', e_versions, args: ['menu'], should_fail: true)
test('dapp_versions_t', e_versions, args: ['people'])
@ -22,8 +22,8 @@ test('dapp_versions_t', e_versions, args: ['people'])
# test everything and unittests
e_test = executable('dapp_test',
'app.d',
d_feature_import_dirs: [data_dir],
d_feature_versions: ['No_Menu', 'With_People'],
d_feature_unittest: true
d_import_dirs: [data_dir],
d_module_versions: ['No_Menu', 'With_People'],
d_unittest: true
)
test('dapp_test', e_test)

Loading…
Cancel
Save