aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-10-01 13:02:08 -0700
committerXavier Claessens <xclaesse@gmail.com>2021-03-19 08:47:10 -0400
commit40e3577a65ac688814eff1239fa38b86aad19ee8 (patch)
tree8329ecb3418c58c43ef7ccf1c0f354aab530ed5f /mesonbuild/build.py
parentf7b0238ed67fc0c9e3cef38090983e33b40fa205 (diff)
downloadmeson-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/build.py')
-rw-r--r--mesonbuild/build.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index b81e5dd..547394f 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -25,6 +25,7 @@ import typing as T
from . import environment
from . import dependencies
from . import mlog
+from . import programs
from .mesonlib import (
File, MesonException, MachineChoice, PerMachine, OrderedSet, listify,
extract_as_list, typeslistify, stringlistify, classify_unity_sources,
@@ -1486,7 +1487,7 @@ class Generator:
if len(args) != 1:
raise InvalidArguments('Generator requires exactly one positional argument: the executable')
exe = unholder(args[0])
- if not isinstance(exe, (Executable, dependencies.ExternalProgram)):
+ if not isinstance(exe, (Executable, programs.ExternalProgram)):
raise InvalidArguments('First generator argument must be an executable.')
self.exe = exe
self.depfile = None
@@ -1610,7 +1611,7 @@ class GeneratedList:
self.depend_files = []
self.preserve_path_from = preserve_path_from
self.extra_args = extra_args if extra_args is not None else []
- if isinstance(self.generator.exe, dependencies.ExternalProgram):
+ if isinstance(self.generator.exe, programs.ExternalProgram):
if not self.generator.exe.found():
raise InvalidArguments('Tried to use not-found external program as generator')
path = self.generator.exe.get_path()
@@ -2176,7 +2177,7 @@ class CommandBase:
elif isinstance(c, File):
self.depend_files.append(c)
final_cmd.append(c)
- elif isinstance(c, dependencies.ExternalProgram):
+ elif isinstance(c, programs.ExternalProgram):
if not c.found():
raise InvalidArguments('Tried to use not-found external program in "command"')
path = c.get_path()