Support waf '--run' with wine

This commit is contained in:
Christian Dywan 2009-06-06 19:28:58 +02:00
parent 35cdff552d
commit c3cb3a20e2

20
wscript
View file

@ -439,7 +439,9 @@ def shutdown ():
elif Options.options.run: elif Options.options.run:
folder = os.path.dirname (Build.bld.env['waf_config_files'][0]) folder = os.path.dirname (Build.bld.env['waf_config_files'][0])
try: try:
relfolder = os.path.relpath (folder) relfolder = folder
if not is_mingw (Build.bld.env):
relfolder = os.path.relpath (folder)
except: except:
pass pass
try: try:
@ -460,8 +462,14 @@ def shutdown ():
'LC_MESSAGES' + os.sep + APPNAME + '.mo') 'LC_MESSAGES' + os.sep + APPNAME + '.mo')
except: except:
pass pass
command = relfolder + os.sep + APPNAME + os.sep + APPNAME command = ext + ' ' + nls + ' '
print ext + ' ' + nls + ' ' + command if is_mingw (Build.bld.env):
Utils.exec_command (ext + ' ' + nls + ' ' + command) # This works only if everything is installed to that prefix
except: os.chdir (Build.bld.env['PREFIX'] + os.sep + 'bin')
Utils.pprint ('RED', "Failed to run application.") command += ' wine cmd /k "PATH=%PATH%;' + Build.bld.env['PREFIX'] + os.sep + 'bin' + ' && ' + APPNAME + '.exe"'
else:
command += ' ' + relfolder + os.sep + APPNAME + os.sep + APPNAME
print command
Utils.exec_command (command)
except Exception, msg:
Utils.pprint ('RED', "Failed to run application: " + str (msg))