mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fixed build.py on windows
This commit is contained in:
parent
9852ec658c
commit
c6848cd229
|
@ -203,29 +203,26 @@ if 1:
|
||||||
# build the game
|
# build the game
|
||||||
if 1:
|
if 1:
|
||||||
print("*** building %s ***" % name)
|
print("*** building %s ***" % name)
|
||||||
|
command = 1
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
winreg_lib = _compatibility._import(("_winreg", "winreg"))
|
file = open("build.bat", "wb")
|
||||||
exec("import %s" % winreg_lib)
|
content = "@echo off\n"
|
||||||
exec("winreg_lib = %s" % winreg_lib)
|
content += "@REM check if we already have the tools in the environment\n"
|
||||||
try:
|
content += "if exist \"%VCINSTALLDIR%\" (\ngoto compile\n)\n"
|
||||||
key = winreg_lib.OpenKey(winreg_lib.HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\VisualStudio\SxS\VS7")
|
content += "@REM Check for Visual Studio\n"
|
||||||
try:
|
content += "if exist \"%VS100COMNTOOLS%\" (\nset VSPATH=\"%VS100COMNTOOLS%\"\ngoto set_env\n)\n"
|
||||||
vsinstalldir = winreg_lib.QueryValueEx(key, "10.0")[0]
|
content += "if exist \"%VS90COMNTOOLS%\" (\nset VSPATH=\"%VS90COMNTOOLS%\"\ngoto set_env\n)\n"
|
||||||
except:
|
content += "if exist \"%VS80COMNTOOLS%\" (\nset VSPATH=\"%VS80COMNTOOLS%\"\ngoto set_env\n)\n\n"
|
||||||
try:
|
content += "echo You need Microsoft Visual Studio 8, 9 or 10 installed\n"
|
||||||
vsinstalldir = winreg_lib.QueryValueEx(key, "9.0")[0]
|
content += "exit\n"
|
||||||
except:
|
content += "@ setup the environment\n"
|
||||||
try:
|
content += ":set_env\n"
|
||||||
vsinstalldir = winreg_lib.QueryValueEx(key, "8.0")[0]
|
content += "call %VSPATH%vsvars32.bat\n\n"
|
||||||
except:
|
content += ":compile\n"
|
||||||
bail("failed to build %s" % name)
|
content += 'cd %s\n"%s\\%s%sbam" config\n"%s\\%s%sbam" %s' % (src_dir_teeworlds, work_dir, src_dir_bam, bam_execution_path, work_dir, src_dir_bam, bam_execution_path, options.release_type)
|
||||||
winreg_lib.CloseKey(key)
|
file.write(content)
|
||||||
file = open("build.bat", "wb")
|
file.close()
|
||||||
file.write(('call "%sVC\\vcvarsall.bat"\ncd %s\n"%s\\%s%sbam" config\n"%s\\%s%sbam" %s' % (vsinstalldir, src_dir_teeworlds, work_dir, src_dir_bam, bam_execution_path, work_dir, src_dir_bam, bam_execution_path, options.release_type)).encode("utf-8"))
|
command = os.system("build.bat")
|
||||||
file.close()
|
|
||||||
command = os.system("build.bat")
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
os.chdir(src_dir_teeworlds)
|
os.chdir(src_dir_teeworlds)
|
||||||
command = os.system("%s/%s%sbam %s" % (work_dir, src_dir_bam, bam_execution_path, options.release_type))
|
command = os.system("%s/%s%sbam %s" % (work_dir, src_dir_bam, bam_execution_path, options.release_type))
|
||||||
|
|
Loading…
Reference in a new issue