summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/mixins/clang.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-11-07 16:00:56 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2020-11-07 22:02:32 +0200
commitfb2eda0274f67f501be1f11a3bc8cb497cefa10f (patch)
treee7afc27cf35beffdf37a4e67ad99741ce0fb8718 /mesonbuild/compilers/mixins/clang.py
parentb6dc4d5e5c6e838de0b52e62d982ba2547eb366d (diff)
downloadmeson-thinlto.tar.gz
Add thinlto support. Closes #7493.thinlto
Diffstat (limited to 'mesonbuild/compilers/mixins/clang.py')
-rw-r--r--mesonbuild/compilers/mixins/clang.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/compilers/mixins/clang.py b/mesonbuild/compilers/mixins/clang.py
index acdb3526e..773d9dc67 100644
--- a/mesonbuild/compilers/mixins/clang.py
+++ b/mesonbuild/compilers/mixins/clang.py
@@ -77,6 +77,13 @@ class ClangCompiler(GnuLikeCompiler):
# so it might change semantics at any time.
return ['-include-pch', os.path.join(pch_dir, self.get_pch_name(header))]
+ def get_lto_compile_args(self, lto_type: str) -> T.List[str]:
+ if lto_type == 'thin':
+ return ['-flto=thin']
+ if lto_type == 'true':
+ return ['-flto']
+ return []
+
def get_compiler_check_args(self, mode: CompileCheckMode) -> T.List[str]:
myargs = [] # type: T.List[str]
if mode is CompileCheckMode.COMPILE: