aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-08-09 13:46:35 -0700
committerDylan Baker <dylan@pnwbakers.com>2019-08-14 13:13:23 -0700
commit06dcbd50eea47b3182081527ea1c0ada01d4d847 (patch)
tree67a3ad1a5f2a78795edbe25851eecb7053306d2b /mesonbuild/compilers/c.py
parent2bd85c614a4c4c513b025680e23afb6697da95dd (diff)
downloadmeson-06dcbd50eea47b3182081527ea1c0ada01d4d847.zip
meson-06dcbd50eea47b3182081527ea1c0ada01d4d847.tar.gz
meson-06dcbd50eea47b3182081527ea1c0ada01d4d847.tar.bz2
compilers: Dispatch to dynamic linker class
Most of the cuda code is from Olexa Bilaniuk. Most of the PGI code is from Michael Hirsc
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r--mesonbuild/compilers/c.py24
1 files changed, 2 insertions, 22 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 589857e..1ec9146 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -27,6 +27,7 @@ from .mixins.intel import IntelGnuLikeCompiler, IntelVisualStudioLikeCompiler
from .mixins.clang import ClangCompiler
from .mixins.elbrus import ElbrusCompiler
from .mixins.pgi import PGICompiler
+from .mixins.islinker import BasicLinkerIsCompilerMixin, LinkerEnvVarsMixin
from .compilers import (
gnu_winlibs,
msvc_winlibs,
@@ -112,14 +113,8 @@ class ClangCCompiler(ClangCompiler, CCompiler):
def get_option_link_args(self, options):
return []
- def get_linker_always_args(self):
- basic = super().get_linker_always_args()
- if self.compiler_type.is_osx_compiler:
- return basic + ['-Wl,-headerpad_max_install_names']
- return basic
-
-class EmscriptenCCompiler(ClangCCompiler):
+class EmscriptenCCompiler(LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, ClangCCompiler):
def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
if not is_cross:
raise MesonException('Emscripten compiler can only be used for cross compilation.')
@@ -129,18 +124,6 @@ class EmscriptenCCompiler(ClangCCompiler):
def get_option_link_args(self, options):
return []
- def get_linker_always_args(self):
- return []
-
- def get_asneeded_args(self):
- return []
-
- def get_lundef_args(self):
- return []
-
- def build_rpath_args(self, *args, **kwargs):
- return []
-
def get_soname_args(self, *args, **kwargs):
raise MesonException('Emscripten does not support shared libraries.')
@@ -388,9 +371,6 @@ class CcrxCCompiler(CcrxCompiler, CCompiler):
def get_output_args(self, target):
return ['-output=obj=%s' % target]
- def get_linker_output_args(self, outputname):
- return ['-output=%s' % outputname]
-
def get_werror_args(self):
return ['-change_message=error']