annotation for the regexing
This commit is contained in:
parent
5398c2a9c2
commit
e59a042490
@ -86,10 +86,10 @@ def gen_cmake_command(config):
|
|||||||
# CC=gcc CXX=g++ cmake [definitions] ..
|
# CC=gcc CXX=g++ cmake [definitions] ..
|
||||||
# by:
|
# by:
|
||||||
# set CC=gcc && set CXX=g++ && cmake [definitions] ..
|
# set CC=gcc && set CXX=g++ && cmake [definitions] ..
|
||||||
p1 = re.compile('\'(?=\w.*\=)')
|
p1 = re.compile('\'(?=\w.*\=)') # match first "'" in 'FOO=BAR'
|
||||||
env1 = p1.sub('\'set ', env)
|
env1 = p1.sub('\'set ', env) # change to 'set FOO=BAR'
|
||||||
p2 = re.compile('\'(?=\s)')
|
p2 = re.compile('\'(?=\s)') # match second "'" in 'FOO=BAR'
|
||||||
env2 = p2.sub(' &&\'', env1)
|
env2 = p2.sub(' &&\'', env1) # change to 'set FOO=BAR &&'
|
||||||
else:
|
else:
|
||||||
env2 = env
|
env2 = env
|
||||||
s.append(' command.append(%s)' % env2)
|
s.append(' command.append(%s)' % env2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user