diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-10-01 13:02:08 -0700 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2021-03-19 08:47:10 -0400 |
commit | 40e3577a65ac688814eff1239fa38b86aad19ee8 (patch) | |
tree | 8329ecb3418c58c43ef7ccf1c0f354aab530ed5f /mesonbuild/cmake | |
parent | f7b0238ed67fc0c9e3cef38090983e33b40fa205 (diff) | |
download | meson-40e3577a65ac688814eff1239fa38b86aad19ee8.zip meson-40e3577a65ac688814eff1239fa38b86aad19ee8.tar.gz meson-40e3577a65ac688814eff1239fa38b86aad19ee8.tar.bz2 |
split program related classes and functions out of dependencies
Dependencies is already a large and complicated package without adding
programs to the list. This also allows us to untangle a bit of spaghetti
that we have.
Diffstat (limited to 'mesonbuild/cmake')
-rw-r--r-- | mesonbuild/cmake/executor.py | 9 | ||||
-rw-r--r-- | mesonbuild/cmake/interpreter.py | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py index 860d410..32c660a 100644 --- a/mesonbuild/cmake/executor.py +++ b/mesonbuild/cmake/executor.py @@ -23,12 +23,13 @@ import re import os from .. import mlog +from ..environment import Environment from ..mesonlib import PerMachine, Popen_safe, version_compare, MachineChoice, is_windows, OptionKey +from ..programs import find_external_program, NonExistingExternalProgram if T.TYPE_CHECKING: from ..environment import Environment - from ..dependencies.base import ExternalProgram - from ..compilers import Compiler + from ..programs import ExternalProgram TYPE_result = T.Tuple[int, T.Optional[str], T.Optional[str]] TYPE_cache_key = T.Tuple[str, T.Tuple[str, ...], str, T.FrozenSet[T.Tuple[str, str]]] @@ -65,9 +66,7 @@ class CMakeExecutor: if self.prefix_paths: self.extra_cmake_args += ['-DCMAKE_PREFIX_PATH={}'.format(';'.join(self.prefix_paths))] - def find_cmake_binary(self, environment: 'Environment', silent: bool = False) -> T.Tuple[T.Optional['ExternalProgram'], T.Optional[str]]: - from ..dependencies.base import find_external_program, NonExistingExternalProgram - + def find_cmake_binary(self, environment: Environment, silent: bool = False) -> T.Tuple[T.Optional['ExternalProgram'], T.Optional[str]]: # Only search for CMake the first time and store the result in the class # definition if isinstance(CMakeExecutor.class_cmakebin[self.for_machine], NonExistingExternalProgram): diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py index cccd358..130723f 100644 --- a/mesonbuild/cmake/interpreter.py +++ b/mesonbuild/cmake/interpreter.py @@ -25,6 +25,7 @@ from .. import mlog, mesonlib from ..mesonlib import MachineChoice, OrderedSet, version_compare, path_is_in_root, relative_to_if_possible, OptionKey from ..mesondata import mesondata from ..compilers.compilers import lang_suffixes, header_suffixes, obj_suffixes, lib_suffixes, is_header +from ..programs import ExternalProgram from enum import Enum from functools import lru_cache from pathlib import Path @@ -750,7 +751,6 @@ class ConverterCustomTarget: if target: # When cross compiling, binaries have to be executed with an exe_wrapper (for instance wine for mingw-w64) if self.env.exe_wrapper is not None and self.env.properties[self.for_machine].get_cmake_use_exe_wrapper(): - from ..dependencies import ExternalProgram assert isinstance(self.env.exe_wrapper, ExternalProgram) cmd += self.env.exe_wrapper.get_command() cmd += [target] |