diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-03-31 13:51:33 +0200 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-05-03 01:39:16 +0200 |
commit | 1280ef238b65af3569f24f81f7c7e1863b50986f (patch) | |
tree | be816faf07889dc59a8af291986a2bfe9c67844b | |
parent | 55379b7d0fcaaa3d8289710c8bbd501aebbbf9e2 (diff) | |
download | meson-1280ef238b65af3569f24f81f7c7e1863b50986f.zip meson-1280ef238b65af3569f24f81f7c7e1863b50986f.tar.gz meson-1280ef238b65af3569f24f81f7c7e1863b50986f.tar.bz2 |
cmake: Fixed list unit test
-rw-r--r-- | mesonbuild/dependencies/base.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 4ef3603..447a635 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -35,7 +35,7 @@ from .. import mesonlib from ..compilers import clib_langs from ..environment import BinaryTable, Environment, MachineInfo from ..mesonlib import MachineChoice, MesonException, OrderedSet, PerMachine -from ..mesonlib import Popen_safe, version_compare_many, version_compare, listify +from ..mesonlib import Popen_safe, version_compare_many, version_compare, listify, stringlistify, extract_as_list from ..mesonlib import Version, LibType # These must be defined in this file to avoid cyclical references. @@ -1074,16 +1074,10 @@ class CMakeDependency(ExternalDependency): if self.cmakeinfo is None: raise self._gen_exception('Unable to obtain CMake system information') - modules = [(x, True) for x in kwargs.get('modules', [])] - modules += [(x, False) for x in kwargs.get('optional_modules', [])] - cm_path = kwargs.get('cmake_module_path', []) - cm_args = kwargs.get('cmake_args', []) - if not isinstance(modules, list): - modules = [modules] - if not isinstance(cm_path, list): - cm_path = [cm_path] - if not isinstance(cm_args, list): - cm_args = [cm_args] + modules = [(x, True) for x in stringlistify(extract_as_list(kwargs, 'modules'))] + modules += [(x, False) for x in stringlistify(extract_as_list(kwargs, 'optional_modules'))] + cm_path = stringlistify(extract_as_list(kwargs, 'cmake_module_path')) + cm_args = stringlistify(extract_as_list(kwargs, 'cmake_args')) cm_path = [x if os.path.isabs(x) else os.path.join(environment.get_source_dir(), x) for x in cm_path] if cm_path: cm_args += ['-DCMAKE_MODULE_PATH={}'.format(';'.join(cm_path))] |