aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
diff options
context:
space:
mode:
authorAndrei Alexeyev <akari@taisei-project.org>2019-10-15 00:59:59 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2019-10-18 00:31:57 +0300
commit50646a87239887fae3ad1173590709590e15c5c0 (patch)
tree0a6d0f8d167f03ad4867a4fb5e2d6a2ad33aa794 /mesonbuild/compilers/c.py
parenta1a8772034aef90e8d58230d8bcfce54ab27bf6a (diff)
downloadmeson-50646a87239887fae3ad1173590709590e15c5c0.zip
meson-50646a87239887fae3ad1173590709590e15c5c0.tar.gz
meson-50646a87239887fae3ad1173590709590e15c5c0.tar.bz2
Refactor duplicate Emscripten code into a mixin
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r--mesonbuild/compilers/c.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 9dc3ef7..7c46627 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -28,6 +28,7 @@ from .mixins.clang import ClangCompiler
from .mixins.elbrus import ElbrusCompiler
from .mixins.pgi import PGICompiler
from .mixins.islinker import BasicLinkerIsCompilerMixin, LinkerEnvVarsMixin
+from .mixins.emscripten import EmscriptenMixin
from .compilers import (
gnu_winlibs,
msvc_winlibs,
@@ -131,7 +132,7 @@ class AppleClangCCompiler(ClangCCompiler):
_C18_VERSION = '>=11.0.0'
-class EmscriptenCCompiler(LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, ClangCCompiler):
+class EmscriptenCCompiler(LinkerEnvVarsMixin, EmscriptenMixin, BasicLinkerIsCompilerMixin, ClangCCompiler):
def __init__(self, exelist, version, for_machine: MachineChoice,
is_cross: bool, info: 'MachineInfo', exe_wrapper=None, **kwargs):
if not is_cross:
@@ -141,18 +142,6 @@ class EmscriptenCCompiler(LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, ClangC
info=info, exe_wrapper=exe_wrapper, **kwargs)
self.id = 'emscripten'
- def get_option_link_args(self, options):
- return []
-
- def get_soname_args(self, *args, **kwargs):
- raise MesonException('Emscripten does not support shared libraries.')
-
- def get_allow_undefined_link_args(self) -> typing.List[str]:
- return ['-s', 'ERROR_ON_UNDEFINED_SYMBOLS=0']
-
- def get_linker_output_args(self, output: str) -> typing.List[str]:
- return ['-o', output]
-
class ArmclangCCompiler(ArmclangCompiler, CCompiler):
def __init__(self, exelist, version, for_machine: MachineChoice,