aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-09-11 19:07:09 -0400
committerEli Schwartz <eschwartz@archlinux.org>2022-09-19 15:19:00 -0400
commit5bfab845d0bc2414e5323d2a59d6c357808c02ea (patch)
tree9941a3c2702cd542fb582d2e7426e788fbddfb6b /mesonbuild
parent0a9048e5546c17a926fd199ded798fba0f76b036 (diff)
downloadmeson-5bfab845d0bc2414e5323d2a59d6c357808c02ea.zip
meson-5bfab845d0bc2414e5323d2a59d6c357808c02ea.tar.gz
meson-5bfab845d0bc2414e5323d2a59d6c357808c02ea.tar.bz2
compilers: directly import from subpackages
It turns out we don't generally need to proxy every compiler ever through the top-level package. The number of times we directly poke at one is negligible and direct imports are pretty clean.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/dependencies/dev.py4
-rw-r--r--mesonbuild/dependencies/dub.py3
-rw-r--r--mesonbuild/linkers/linkers.py8
-rw-r--r--mesonbuild/modules/cuda.py2
4 files changed, 9 insertions, 8 deletions
diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py
index 08c9280..bf9ba2b 100644
--- a/mesonbuild/dependencies/dev.py
+++ b/mesonbuild/dependencies/dev.py
@@ -27,7 +27,9 @@ import typing as T
from mesonbuild.interpreterbase.decorators import FeatureDeprecated
from .. import mesonlib, mlog
-from ..compilers import AppleClangCCompiler, AppleClangCPPCompiler, detect_compiler_for
+from ..compilers.c import AppleClangCCompiler
+from ..compilers.cpp import AppleClangCPPCompiler
+from ..compilers.detect import detect_compiler_for
from ..environment import get_llvm_tool_names
from ..mesonlib import version_compare, stringlistify, extract_as_list
from .base import DependencyException, DependencyMethods, strip_system_libdirs, SystemDependency, ExternalDependency, DependencyTypeName
diff --git a/mesonbuild/dependencies/dub.py b/mesonbuild/dependencies/dub.py
index 0680141..cad4aad 100644
--- a/mesonbuild/dependencies/dub.py
+++ b/mesonbuild/dependencies/dub.py
@@ -17,8 +17,7 @@ from .pkgconfig import PkgConfigDependency
from ..mesonlib import (Popen_safe, OptionKey)
from ..mesonlib.universal import join_args
from ..programs import ExternalProgram
-from ..compilers import DCompiler
-from ..compilers.d import d_feature_args
+from ..compilers.d import DCompiler, d_feature_args
from .. import mlog
import re
import os
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
index 5b7f69e..30f41af 100644
--- a/mesonbuild/linkers/linkers.py
+++ b/mesonbuild/linkers/linkers.py
@@ -137,12 +137,12 @@ class VisualStudioLikeLinker:
@classmethod
def unix_args_to_native(cls, args: T.List[str]) -> T.List[str]:
- from ..compilers import VisualStudioCCompiler
+ from ..compilers.c import VisualStudioCCompiler
return VisualStudioCCompiler.unix_args_to_native(args)
@classmethod
def native_args_to_unix(cls, args: T.List[str]) -> T.List[str]:
- from ..compilers import VisualStudioCCompiler
+ from ..compilers.c import VisualStudioCCompiler
return VisualStudioCCompiler.native_args_to_unix(args)
def rsp_file_syntax(self) -> RSPFileSyntax:
@@ -1126,7 +1126,7 @@ class NAGDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
return []
def get_std_shared_lib_args(self) -> T.List[str]:
- from ..compilers import NAGFortranCompiler
+ from ..compilers.fortran import NAGFortranCompiler
return NAGFortranCompiler.get_nagfor_quiet(self.version) + ['-Wl,-shared']
@@ -1495,7 +1495,7 @@ class CudaLinker(PosixDynamicLinkerMixin, DynamicLinker):
#
# nvcc fatal : Don't know what to do with 'subprojects/foo/libbar.so.0.1.2'
#
- from ..compilers import CudaCompiler
+ from ..compilers.cuda import CudaCompiler
return CudaCompiler.LINKER_PREFIX
def fatal_warnings(self) -> T.List[str]:
diff --git a/mesonbuild/modules/cuda.py b/mesonbuild/modules/cuda.py
index df9dba8..0e33984 100644
--- a/mesonbuild/modules/cuda.py
+++ b/mesonbuild/modules/cuda.py
@@ -17,7 +17,7 @@ import typing as T
import re
from ..mesonlib import version_compare
-from ..compilers import CudaCompiler
+from ..compilers.cuda import CudaCompiler
from . import NewExtensionModule, ModuleInfo