aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index df448f0..4ab4dc6 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -13,7 +13,7 @@
# limitations under the License.
import contextlib, enum, os.path, re, tempfile, shlex
-from typing import Optional, Tuple
+from typing import Optional, Tuple, List
from ..linkers import StaticLinker
from .. import coredata
@@ -278,10 +278,9 @@ def option_enabled(boptions, options, option):
def get_base_compile_args(options, compiler):
args = []
- # FIXME, gcc/clang specific.
try:
if options['b_lto'].value:
- args.append('-flto')
+ args.extend(compiler.get_lto_compile_args())
except KeyError:
pass
try:
@@ -328,10 +327,9 @@ def get_base_compile_args(options, compiler):
def get_base_link_args(options, linker, is_shared_module):
args = []
- # FIXME, gcc/clang specific.
try:
if options['b_lto'].value:
- args.append('-flto')
+ args.extend(linker.get_lto_link_args())
except KeyError:
pass
try:
@@ -1197,6 +1195,12 @@ class Compiler:
def remove_linkerlike_args(self, args):
return [x for x in args if not x.startswith('-Wl')]
+ def get_lto_compile_args(self) -> List[str]:
+ return []
+
+ def get_lto_link_args(self) -> List[str]:
+ return []
+
@enum.unique
class CompilerType(enum.Enum):