diff options
author | Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com> | 2020-05-21 18:58:47 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-05-22 16:58:12 +0300 |
commit | 9dc3ca2c1c9fbb47e731551c6432df144f725261 (patch) | |
tree | 404adf95bb405fcef5a048d490922046ae14d960 /mesonbuild/compilers/cpp.py | |
parent | 29ef4478df6d3aaca40c7993f125b29409be1de2 (diff) | |
download | meson-9dc3ca2c1c9fbb47e731551c6432df144f725261.zip meson-9dc3ca2c1c9fbb47e731551c6432df144f725261.tar.gz meson-9dc3ca2c1c9fbb47e731551c6432df144f725261.tar.bz2 |
compilers: add fetching of define list for clang
Simmilar to gcc, the list of pre-processor defines can be fetched with
`-dM -E` option. The way cpu_family is determined on linux relies on
this list.
Fixes incorrect value of cpu_family on linux, when crosscompiling:
```
CC="clang -m32" meson ./build
```
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
Diffstat (limited to 'mesonbuild/compilers/cpp.py')
-rw-r--r-- | mesonbuild/compilers/cpp.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index f4bcfa9..478a68c 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -155,10 +155,11 @@ class CPPCompiler(CLikeCompiler, Compiler): class ClangCPPCompiler(ClangCompiler, CPPCompiler): def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): + is_cross, info: 'MachineInfo', exe_wrapper=None, + defines : T.Optional[T.List[str]] = None, **kwargs): CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, **kwargs) - ClangCompiler.__init__(self) + ClangCompiler.__init__(self, defines) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] self.warn_args = {'0': [], '1': default_warn_args, |