diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-10-18 09:15:48 -0700 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2019-07-23 09:58:24 +0000 |
commit | 7eb1d89095054286391565a23c6a4d27465dd617 (patch) | |
tree | 9fa2b9bf1231eef0ddd8587bad2b6dfc6a853afb /mesonbuild/compilers/mixins | |
parent | 32c57ca7822fcba084afed8268789552b7ef11c3 (diff) | |
download | meson-7eb1d89095054286391565a23c6a4d27465dd617.zip meson-7eb1d89095054286391565a23c6a4d27465dd617.tar.gz meson-7eb1d89095054286391565a23c6a4d27465dd617.tar.bz2 |
compilers: Move lto args into compiler class
There are two problems, one is that it assumes -flto is the argument
to do LTO/WPO, which isn't true of ICC and MSVC (and presumably)
others. It's also incorrect because it assumes that the compiler and
linker will always be the same, which isn't necessarily true. You
could combine GCC with Apple's linker, or clang with link.exe, which
use different arguments.
Diffstat (limited to 'mesonbuild/compilers/mixins')
-rw-r--r-- | mesonbuild/compilers/mixins/gnu.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py index 46f04c4..c575045 100644 --- a/mesonbuild/compilers/mixins/gnu.py +++ b/mesonbuild/compilers/mixins/gnu.py @@ -366,6 +366,12 @@ class GnuLikeCompiler(metaclass=abc.ABCMeta): return self._split_fetch_real_dirs(line.split('=', 1)[1]) return [] + def get_lto_compile_args(self) -> typing.List[str]: + return ['-flto'] + + def get_lto_link_args(self) -> typing.List[str]: + return ['-flto'] + class GnuCompiler(GnuLikeCompiler): """ |