summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Environment.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Environment.py')
-rw-r--r--src/engine/SCons/Environment.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index 36b7c3d..2c80424 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -2199,6 +2199,27 @@ class Base(SubstitutionEnvironment):
target.side_effects.append(side_effect)
return side_effects
+ def Split(self, arg):
+ """This function converts a string or list into a list of strings
+ or Nodes. This makes things easier for users by allowing files to
+ be specified as a white-space separated list to be split.
+
+ The input rules are:
+ - A single string containing names separated by spaces. These will be
+ split apart at the spaces.
+ - A single Node instance
+ - A list containing either strings or Node instances. Any strings
+ in the list are not split at spaces.
+
+ In all cases, the function returns a list of Nodes and strings."""
+
+ if SCons.Util.is_List(arg):
+ return list(map(self.subst, arg))
+ elif SCons.Util.is_String(arg):
+ return self.subst(arg).split()
+ else:
+ return [self.subst(arg)]
+
def Value(self, value, built_value=None):
"""
"""