Merge pull request #1344 from aozima/pulls

update scons script: strict SrcRemove() match rule.
This commit is contained in:
Bernard Xiong 2018-04-08 10:51:03 +08:00 committed by GitHub
commit ac6302db30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -7,7 +7,7 @@ src = Glob('*.c')
if GetDepend('RT_USING_LWIP') == False: if GetDepend('RT_USING_LWIP') == False:
SrcRemove(src, 'sam7x_emac.c') SrcRemove(src, 'sam7x_emac.c')
if GetDepend('RT_USING_DFS') == False: if GetDepend('RT_USING_DFS') == False:
SrcRemove(src, 'ssd.c') SrcRemove(src, 'sd.c')
CPPPATH = [cwd] CPPPATH = [cwd]

View File

@ -743,10 +743,19 @@ def SrcRemove(src, remove):
for item in src: for item in src:
if type(item) == type('str'): if type(item) == type('str'):
if os.path.basename(item) in remove: item_str = item
else:
item_str = item.rstr()
if os.path.isabs(item_str):
item_str = os.path.relpath(item_str, GetCurrentDir())
if type(remove) == type('str'):
if item_str == remove:
src.remove(item) src.remove(item)
else: else:
if os.path.basename(item.rstr()) in remove: for remove_item in remove:
if item_str == str(remove_item):
src.remove(item) src.remove(item)
def GetVersion(): def GetVersion():