diff options
author | Alistair Thomas <astavale@yahoo.co.uk> | 2017-06-23 00:42:41 +0100 |
---|---|---|
committer | Alistair Thomas <astavale@yahoo.co.uk> | 2017-06-23 00:42:41 +0100 |
commit | 117f4ab8b5c7ff0bdaabe42b0945a0963d43e477 (patch) | |
tree | 453406207ace45e1b2bf6935ee81fb9fd8a25c22 /mesonbuild/environment.py | |
parent | d71da5bdb335e331a220a359637b890f8393edef (diff) | |
download | meson-117f4ab8b5c7ff0bdaabe42b0945a0963d43e477.zip meson-117f4ab8b5c7ff0bdaabe42b0945a0963d43e477.tar.gz meson-117f4ab8b5c7ff0bdaabe42b0945a0963d43e477.tar.bz2 |
Split out languages from compilers.py
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 62 |
1 files changed, 54 insertions, 8 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 4d3adc8..3be068a 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -14,9 +14,55 @@ import configparser, os, platform, re, shlex, shutil, subprocess -from .compilers import * +from . import coredata from .linkers import ArLinker, VisualStudioLinker +from . import mesonlib from .mesonlib import EnvironmentException, Popen_safe +from . import mlog + +from . import compilers +from .compilers import ( + CLANG_OSX, + CLANG_STANDARD, + CLANG_WIN, + GCC_CYGWIN, + GCC_MINGW, + GCC_OSX, + GCC_STANDARD, + ICC_STANDARD, + is_assembly, + is_header, + is_library, + is_llvm_ir, + is_object, + is_source, +) +from .compilers import ( + ClangCCompiler, + ClangCPPCompiler, + ClangObjCCompiler, + ClangObjCPPCompiler, + G95FortranCompiler, + GnuCCompiler, + GnuCPPCompiler, + GnuFortranCompiler, + GnuObjCCompiler, + GnuObjCPPCompiler, + IntelCCompiler, + IntelCPPCompiler, + IntelFortranCompiler, + JavaCompiler, + MonoCompiler, + NAGFortranCompiler, + Open64FortranCompiler, + PathScaleFortranCompiler, + PGIFortranCompiler, + RustCompiler, + SunFortranCompiler, + ValaCompiler, + VisualStudioCCompiler, + VisualStudioCPPCompiler, +) build_filename = 'meson.build' @@ -680,11 +726,11 @@ class Environment: raise EnvironmentException('Could not execute D compiler "%s"' % ' '.join(exelist)) version = search_version(out) if 'LLVM D compiler' in out: - return LLVMDCompiler(exelist, version, is_cross) + return compilers.LLVMDCompiler(exelist, version, is_cross) elif 'gdc' in out: - return GnuDCompiler(exelist, version, is_cross) + return compilers.GnuDCompiler(exelist, version, is_cross) elif 'Digital Mars' in out: - return DmdDCompiler(exelist, version, is_cross) + return compilers.DmdDCompiler(exelist, version, is_cross) raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') def detect_swift_compiler(self): @@ -695,7 +741,7 @@ class Environment: raise EnvironmentException('Could not execute Swift compiler "%s"' % ' '.join(exelist)) version = search_version(err) if 'Swift' in err: - return SwiftCompiler(exelist, version) + return compilers.SwiftCompiler(exelist, version) raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') def detect_static_linker(self, compiler): @@ -708,12 +754,12 @@ class Environment: evar = 'AR' if evar in os.environ: linkers = [shlex.split(os.environ[evar])] - elif isinstance(compiler, VisualStudioCCompiler): + elif isinstance(compiler, compilers.VisualStudioCCompiler): linkers = [self.vs_static_linker] - elif isinstance(compiler, GnuCompiler): + elif isinstance(compiler, compilers.GnuCompiler): # Use gcc-ar if available; needed for LTO linkers = [self.gcc_static_linker, self.default_static_linker] - elif isinstance(compiler, ClangCompiler): + elif isinstance(compiler, compilers.ClangCompiler): # Use llvm-ar if available; needed for LTO linkers = [self.clang_static_linker, self.default_static_linker] else: |