aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.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-08 16:00:05 +0200
commit3e6fbde94c1cb8d4e01b7daf0282c315ff0e6c7d (patch)
treee7afc27cf35beffdf37a4e67ad99741ce0fb8718 /mesonbuild/compilers/compilers.py
parentb6dc4d5e5c6e838de0b52e62d982ba2547eb366d (diff)
downloadmeson-3e6fbde94c1cb8d4e01b7daf0282c315ff0e6c7d.zip
meson-3e6fbde94c1cb8d4e01b7daf0282c315ff0e6c7d.tar.gz
meson-3e6fbde94c1cb8d4e01b7daf0282c315ff0e6c7d.tar.bz2
Add thinlto support. Closes #7493.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 0f074bb..6a54622 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -266,7 +266,9 @@ clike_debug_args = {False: [],
True: ['-g']} # type: T.Dict[bool, T.List[str]]
base_options = {'b_pch': coredata.UserBooleanOption('Use precompiled headers', True),
- 'b_lto': coredata.UserBooleanOption('Use link time optimization', False),
+ 'b_lto': coredata.UserComboOption('Use link time optimization',
+ ['false', 'true', 'thin'],
+ 'false'),
'b_sanitize': coredata.UserComboOption('Code sanitizer to use',
['none', 'address', 'thread', 'undefined', 'memory', 'address,undefined'],
'none'),
@@ -307,8 +309,7 @@ def option_enabled(boptions: T.List[str], options: 'OptionDictType',
def get_base_compile_args(options: 'OptionDictType', compiler: 'Compiler') -> T.List[str]:
args = [] # type T.List[str]
try:
- if options['b_lto'].value:
- args.extend(compiler.get_lto_compile_args())
+ args.extend(compiler.get_lto_compile_args(options['b_lto'].value))
except KeyError:
pass
try:
@@ -357,8 +358,7 @@ def get_base_link_args(options: 'OptionDictType', linker: 'Compiler',
is_shared_module: bool) -> T.List[str]:
args = [] # type: T.List[str]
try:
- if options['b_lto'].value:
- args.extend(linker.get_lto_link_args())
+ args.extend(linker.get_lto_link_args(options['b_lto'].value))
except KeyError:
pass
try:
@@ -940,11 +940,11 @@ class Compiler(metaclass=abc.ABCMeta):
ret.append(arg)
return ret
- def get_lto_compile_args(self) -> T.List[str]:
+ def get_lto_compile_args(self, lto_type: str) -> T.List[str]:
return []
- def get_lto_link_args(self) -> T.List[str]:
- return self.linker.get_lto_args()
+ def get_lto_link_args(self, lto_type: str) -> T.List[str]:
+ return self.linker.get_lto_args(lto_type)
def sanitizer_compile_args(self, value: str) -> T.List[str]:
return []