mirror of https://gitlab.com/ita1024/waf.git
More Msys2 fun!
This commit is contained in:
parent
0357db5156
commit
971b2d32b7
|
@ -59,14 +59,11 @@ Ant patterns for files and folders to exclude while doing the
|
||||||
recursive traversal in :py:meth:`waflib.Node.Node.ant_glob`
|
recursive traversal in :py:meth:`waflib.Node.Node.ant_glob`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# TODO waf 1.9
|
# TODO remove in waf 1.9
|
||||||
split_path = Utils.split_path_unix
|
split_path = Utils.split_path
|
||||||
|
split_path_unix = Utils.split_path_unix
|
||||||
split_path_cygwin = Utils.split_path_cygwin
|
split_path_cygwin = Utils.split_path_cygwin
|
||||||
split_path_win32 = Utils.split_path_win32
|
split_path_win32 = Utils.split_path_win32
|
||||||
if sys.platform == 'cygwin':
|
|
||||||
split_path = split_path_cygwin
|
|
||||||
elif Utils.is_win32:
|
|
||||||
split_path = split_path_win32
|
|
||||||
|
|
||||||
class Node(object):
|
class Node(object):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -158,7 +158,10 @@ class link_task(Task.Task):
|
||||||
if len(nums) >= 2:
|
if len(nums) >= 2:
|
||||||
pattern += '.%s' % nums[1]
|
pattern += '.%s' % nums[1]
|
||||||
|
|
||||||
|
if folder:
|
||||||
tmp = folder + os.sep + pattern % name
|
tmp = folder + os.sep + pattern % name
|
||||||
|
else:
|
||||||
|
tmp = pattern % name
|
||||||
target = self.generator.path.find_or_declare(tmp)
|
target = self.generator.path.find_or_declare(tmp)
|
||||||
self.set_outputs(target)
|
self.set_outputs(target)
|
||||||
|
|
||||||
|
|
|
@ -409,9 +409,24 @@ def split_path_win32(path):
|
||||||
return ret
|
return ret
|
||||||
return re.split(re_sp, path)
|
return re.split(re_sp, path)
|
||||||
|
|
||||||
|
msysroot = None
|
||||||
|
def split_path_msys(path):
|
||||||
|
if (path.startswith('/') or path.startswith('\\')) and not path.startswith('//') and not path.startswith('\\\\'):
|
||||||
|
# msys paths can be in the form /usr/bin
|
||||||
|
global msysroot
|
||||||
|
if not msysroot:
|
||||||
|
# msys has python 2.7 or 3, so we can use this
|
||||||
|
msysroot = subprocess.check_output(['cygpath', '-w', '/']).decode(sys.stdout.encoding or 'iso8859-1')
|
||||||
|
msysroot = msysroot.strip()
|
||||||
|
path = os.path.normpath(msysroot + os.sep + path)
|
||||||
|
return split_path_win32(path)
|
||||||
|
|
||||||
if sys.platform == 'cygwin':
|
if sys.platform == 'cygwin':
|
||||||
split_path = split_path_cygwin
|
split_path = split_path_cygwin
|
||||||
elif is_win32:
|
elif is_win32:
|
||||||
|
if os.environ.get('MSYSTEM', None):
|
||||||
|
split_path = split_path_msys
|
||||||
|
else:
|
||||||
split_path = split_path_win32
|
split_path = split_path_win32
|
||||||
else:
|
else:
|
||||||
split_path = split_path_unix
|
split_path = split_path_unix
|
||||||
|
|
Loading…
Reference in New Issue