aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/linkers/detect.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-03-01 23:55:42 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-03-07 19:09:50 -0500
commitc231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e (patch)
treee2e782b9d7883b96a1bcecc13ddc51d6656bdf20 /mesonbuild/linkers/detect.py
parenta009eacc65ddb447edcfc9fd317ad828d9b3353a (diff)
downloadmeson-c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e.zip
meson-c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e.tar.gz
meson-c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e.tar.bz2
move a bunch of imports into TYPE_CHECKING blocks
These are only used for type checking, so don't bother importing them at runtime. Generally add future annotations at the same time, to make sure that existing uses of these imports don't need to be quoted.
Diffstat (limited to 'mesonbuild/linkers/detect.py')
-rw-r--r--mesonbuild/linkers/detect.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/linkers/detect.py b/mesonbuild/linkers/detect.py
index 0bfd708..80e0948 100644
--- a/mesonbuild/linkers/detect.py
+++ b/mesonbuild/linkers/detect.py
@@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import annotations
+
from ..mesonlib import (
- EnvironmentException, MachineChoice, OptionKey,
+ EnvironmentException, OptionKey,
Popen_safe, search_version
)
from .linkers import (
- DynamicLinker,
AppleDynamicLinker,
- GnuDynamicLinker,
GnuGoldDynamicLinker,
GnuBFDDynamicLinker,
LLVMDynamicLinker,
@@ -36,8 +36,10 @@ import shlex
import typing as T
if T.TYPE_CHECKING:
+ from .linkers import DynamicLinker, GnuDynamicLinker
from ..environment import Environment
from ..compilers import Compiler
+ from ..mesonlib import MachineChoice
defaults: T.Dict[str, T.List[str]] = {}
defaults['static_linker'] = ['ar', 'gar']