|
@@ -7,15 +7,6 @@ from collections import OrderedDict
|
|
|
from collections.abc import Mapping
|
|
|
from typing import Iterator
|
|
|
|
|
|
-# We need to define our own `Action` method to control the verbosity of output
|
|
|
-# and whenever we need to run those commands in a subprocess on some platforms.
|
|
|
-from SCons import Node
|
|
|
-from SCons.Script import Action
|
|
|
-from SCons.Script import ARGUMENTS
|
|
|
-from SCons.Script import Glob
|
|
|
-from SCons.Variables.BoolVariable import _text2bool
|
|
|
-from platform_methods import run_in_subprocess
|
|
|
-
|
|
|
|
|
|
def add_source_files(self, sources, files):
|
|
|
# Convert string to list of absolute paths (including expanding wildcard)
|
|
@@ -220,6 +211,9 @@ def get_cmdline_bool(option, default):
|
|
|
"""We use `ARGUMENTS.get()` to check if options were manually overridden on the command line,
|
|
|
and SCons' _text2bool helper to convert them to booleans, otherwise they're handled as strings.
|
|
|
"""
|
|
|
+ from SCons.Script import ARGUMENTS
|
|
|
+ from SCons.Variables.BoolVariable import _text2bool
|
|
|
+
|
|
|
cmdline_val = ARGUMENTS.get(option)
|
|
|
if cmdline_val is not None:
|
|
|
return _text2bool(cmdline_val)
|
|
@@ -703,6 +697,9 @@ def generate_cpp_hint_file(filename):
|
|
|
|
|
|
|
|
|
def glob_recursive(pattern, node="."):
|
|
|
+ from SCons import Node
|
|
|
+ from SCons.Script import Glob
|
|
|
+
|
|
|
results = []
|
|
|
for f in Glob(str(node) + "/*", source=True):
|
|
|
if type(f) is Node.FS.Dir:
|
|
@@ -913,6 +910,9 @@ def CommandNoCache(env, target, sources, command, **args):
|
|
|
|
|
|
|
|
|
def Run(env, function, short_message, subprocess=True):
|
|
|
+ from SCons.Script import Action
|
|
|
+ from platform_methods import run_in_subprocess
|
|
|
+
|
|
|
output_print = short_message if not env["verbose"] else ""
|
|
|
if not subprocess:
|
|
|
return Action(function, output_print)
|