diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-05-03 00:44:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-03 00:44:37 +0300 |
commit | 6c115f1626f9f1f945b3de75ca38f5bc2ac4aad3 (patch) | |
tree | 66f687ed20229ff8e2515d2df0ec9ed27997faea /mesonbuild/compilers | |
parent | 8d5598227ecc9be346919532fd1ee0cf71a82312 (diff) | |
parent | a2fdaa9ea081304dda70557755f5895194227668 (diff) | |
download | meson-6c115f1626f9f1f945b3de75ca38f5bc2ac4aad3.zip meson-6c115f1626f9f1f945b3de75ca38f5bc2ac4aad3.tar.gz meson-6c115f1626f9f1f945b3de75ca38f5bc2ac4aad3.tar.bz2 |
Merge pull request #3474 from mesonbuild/dcpp
Can combine D and C++ in a single target.
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 6 | ||||
-rw-r--r-- | mesonbuild/compilers/cpp.py | 6 | ||||
-rw-r--r-- | mesonbuild/compilers/fortran.py | 4 |
3 files changed, 15 insertions, 1 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index a2c6668..02faed2 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -938,6 +938,12 @@ class Compiler: def openmp_flags(self): raise EnvironmentException('Language %s does not support OpenMP flags.' % self.get_display_language()) + def language_stdlib_only_link_flags(self): + # The linker flags needed to link the standard library of the current + # language in. This is needed in cases where you e.g. combine D and C++ + # and both of which need to link their runtime library in or otherwise + # building fails with undefined symbols. + return [] GCC_STANDARD = 0 GCC_OSX = 1 diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 4c48052..051f922 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -93,6 +93,9 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler): def get_option_link_args(self, options): return [] + def language_stdlib_only_link_flags(self): + return ['-lstdc++'] + class GnuCPPCompiler(GnuCompiler, CPPCompiler): def __init__(self, exelist, version, gcc_type, is_cross, exe_wrap, defines, **kwargs): @@ -134,6 +137,9 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler): def get_pch_use_args(self, pch_dir, header): return ['-fpch-preprocess', '-include', os.path.basename(header)] + def language_stdlib_only_link_flags(self): + return ['-lstdc++'] + class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler): def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None, defines=None, **kwargs): diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 9d3240f..87fa702 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -183,13 +183,15 @@ class GnuFortranCompiler(FortranCompiler): def openmp_flags(self): return ['-fopenmp'] + def language_stdlib_only_link_flags(self): + return ['-lgfortran', '-lm', '-lquadmath'] + class ElbrusFortranCompiler(GnuFortranCompiler, ElbrusCompiler): def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None, defines=None, **kwargs): GnuFortranCompiler.__init__(self, exelist, version, gcc_type, is_cross, exe_wrapper, defines, **kwargs) ElbrusCompiler.__init__(self, gcc_type, defines) - class G95FortranCompiler(FortranCompiler): def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags): super().__init__(exelist, version, is_cross, exe_wrapper=None, **kwags) |