diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-12-29 18:23:36 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-12-30 20:01:56 +0200 |
commit | e4ba1fe89fa849397785863e504f5071bf375a7c (patch) | |
tree | 94e84a20cc05421ded36dae318e43899fe9b57c7 | |
parent | 4df9006ca43338fea07b9d542f94da34369e43d3 (diff) | |
download | meson-fix4671.tar.gz |
Handle strings in cross file args. Closes #4671.fix4671
-rw-r--r-- | cross/ubuntu-armhf.txt | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/compilers.py | 4 | ||||
-rw-r--r-- | test cases/common/137 get define/meson.build | 12 |
3 files changed, 6 insertions, 12 deletions
diff --git a/cross/ubuntu-armhf.txt b/cross/ubuntu-armhf.txt index fec8ce7de..a6e1f1555 100644 --- a/cross/ubuntu-armhf.txt +++ b/cross/ubuntu-armhf.txt @@ -12,7 +12,7 @@ pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config' root = '/usr/arm-linux-gnueabihf' # Used in unit test '140 get define' c_args = ['-DMESON_TEST_ISSUE_1665=1'] -cpp_args = ['-DMESON_TEST_ISSUE_1665=1'] +cpp_args = '-DMESON_TEST_ISSUE_1665=1' has_function_printf = true has_function_hfkerhisadf = false diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 2a5c9763a..31047b14e 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1048,10 +1048,10 @@ class Compiler: if 'properties' in environment.cross_info.config: props = environment.cross_info.config['properties'] lang_args_key = self.language + '_args' - extra_flags += props.get(lang_args_key, []) + extra_flags += mesonlib.stringlistify(props.get(lang_args_key, [])) lang_link_args_key = self.language + '_link_args' if link: - extra_flags += props.get(lang_link_args_key, []) + extra_flags += mesonlib.stringlistify(props.get(lang_link_args_key, [])) return extra_flags def _get_compile_output(self, dirname, mode): diff --git a/test cases/common/137 get define/meson.build b/test cases/common/137 get define/meson.build index 109f628ce..1647e22e8 100644 --- a/test cases/common/137 get define/meson.build +++ b/test cases/common/137 get define/meson.build @@ -67,15 +67,9 @@ foreach lang : ['c', 'cpp'] run_1665_test = false if meson.is_cross_build() - # Can't use an empty array as a fallback here because of - # https://github.com/mesonbuild/meson/issues/1481 - lang_args = meson.get_cross_property(lang + '_args', []) - if lang_args.length() != 0 - foreach lang_arg : lang_args - if lang_arg.contains('MESON_TEST_ISSUE_1665') - run_1665_test = true - endif - endforeach + lang_arg = meson.get_cross_property(lang + '_args', '') + if lang_arg == '-DMESON_TEST_ISSUE_1665=1' + run_1665_test = true endif endif |