remove win32 dependency in update.py

the command line rewrite needs to happen in setup.py
(ideally by a function defined in config.py)
otherwise setup.py becomes hardcoded to a platform
and we want it portable
This commit is contained in:
Radovan Bast 2015-06-28 19:36:33 +02:00
parent 36ab8c14a7
commit 7d3f2c1527

View File

@ -81,20 +81,7 @@ def gen_cmake_command(config):
for section in config.sections(): for section in config.sections():
if config.has_option(section, 'export'): if config.has_option(section, 'export'):
for env in config.get(section, 'export').split('\n'): for env in config.get(section, 'export').split('\n'):
# FIXME there may be no win32 check in this file s.append(' command.append(%s)' % env)
# win32 platform dependency has to be dealt with in setup.py
if sys.platform == 'win32':
# on windows we have to replace:
# CC=gcc CXX=g++ cmake [definitions] ..
# by:
# set CC=gcc && set CXX=g++ && cmake [definitions] ..
p1 = re.compile('\'(?=\w.*\=)') # match first "'" in 'FOO=BAR'
env1 = p1.sub('\'set ', env) # change to 'set FOO=BAR'
p2 = re.compile('\'(?=\s)') # match second "'" in 'FOO=BAR'
env2 = p2.sub(' &&\'', env1) # change to 'set FOO=BAR &&'
else:
env2 = env
s.append(' command.append(%s)' % env2)
s.append(" command.append('cmake')") s.append(" command.append('cmake')")