[tools/building.py]fixed SrcRemove /\ convert issue.

This commit is contained in:
xieyangrun 2018-06-14 09:30:35 +08:00
parent 35a0e8e8c9
commit 86ae6146fd
1 changed files with 43 additions and 20 deletions

View File

@ -803,6 +803,13 @@ def SrcRemove(src, remove):
if not src:
return
src_bak = src
if type(remove) == type('str'):
if os.path.isabs(remove):
remove = os.path.relpath(remove, GetCurrentDir())
remove = os.path.normpath(remove)
for item in src:
if type(item) == type('str'):
item_str = item
@ -811,14 +818,30 @@ def SrcRemove(src, remove):
if os.path.isabs(item_str):
item_str = os.path.relpath(item_str, GetCurrentDir())
item_str = os.path.normpath(item_str)
if type(remove) == type('str'):
if item_str == remove:
src.remove(item)
src_bak.remove(item)
else:
for remove_item in remove:
if item_str == str(remove_item):
src.remove(item)
remove_str = str(remove_item)
if os.path.isabs(remove_str):
remove_str = os.path.relpath(remove_str, GetCurrentDir())
remove_str = os.path.normpath(remove_str)
for item in src:
if type(item) == type('str'):
item_str = item
else:
item_str = item.rstr()
if os.path.isabs(item_str):
item_str = os.path.relpath(item_str, GetCurrentDir())
item_str = os.path.normpath(item_str)
if item_str == remove_str:
src_bak.remove(item)
src = src_bak
def GetVersion():
import SCons.cpp