aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/swift.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-08-18 20:39:47 +0300
committerGitHub <noreply@github.com>2018-08-18 20:39:47 +0300
commitd83f77109a7ac22da53acfad8f7ff078d929cd9d (patch)
treeba2dc20e3a91379008d6c7c841a4f503d50b5bd8 /mesonbuild/compilers/swift.py
parent8277d94e24d4382d49289c07ef20ea78d95443e1 (diff)
downloadmeson-d83f77109a7ac22da53acfad8f7ff078d929cd9d.zip
meson-d83f77109a7ac22da53acfad8f7ff078d929cd9d.tar.gz
meson-d83f77109a7ac22da53acfad8f7ff078d929cd9d.tar.bz2
Convert buildtype to optimization and debug options (#3489)
Diffstat (limited to 'mesonbuild/compilers/swift.py')
-rw-r--r--mesonbuild/compilers/swift.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/mesonbuild/compilers/swift.py b/mesonbuild/compilers/swift.py
index 59997d6..4d5dd0c 100644
--- a/mesonbuild/compilers/swift.py
+++ b/mesonbuild/compilers/swift.py
@@ -16,7 +16,15 @@ import subprocess, os.path
from ..mesonlib import EnvironmentException
-from .compilers import Compiler, swift_buildtype_args
+from .compilers import Compiler, swift_buildtype_args, clike_debug_args
+
+swift_optimization_args = {'0': [],
+ 'g': [],
+ '1': ['-O'],
+ '2': ['-O'],
+ '3': ['-O'],
+ 's': ['-O'],
+ }
class SwiftCompiler(Compiler):
def __init__(self, exelist, version):
@@ -97,3 +105,9 @@ class SwiftCompiler(Compiler):
raise EnvironmentException('Swift compiler %s can not compile programs.' % self.name_string())
if subprocess.call(output_name) != 0:
raise EnvironmentException('Executables created by Swift compiler %s are not runnable.' % self.name_string())
+
+ def get_debug_args(self, is_debug):
+ return clike_debug_args[is_debug]
+
+ def get_optimization_args(self, optimization_level):
+ return swift_optimization_args[optimization_level]