Fixing windows prefab debug build

This commit is contained in:
Eric Froemling 2020-10-10 15:23:58 -07:00
parent 94dce555c8
commit 3c8cea09cb
2 changed files with 14 additions and 9 deletions

View File

@ -263,7 +263,7 @@ def _sync_windows_extras(cfg: Config) -> None:
'SDL2.dll' 'SDL2.dll'
] ]
elif cfg.win_type == 'winserver': elif cfg.win_type == 'winserver':
toplevelfiles += ['python.exe'] toplevelfiles += [f'python{dbgsfx}.exe']
# Include debug dlls so folks without msvc can run them. # Include debug dlls so folks without msvc can run them.
if cfg.debug: if cfg.debug:

View File

@ -57,14 +57,19 @@ def stage_server_file() -> None:
# Run Python in opt mode for release builds. # Run Python in opt mode for release builds.
with open(infilename) as infile: with open(infilename) as infile:
lines = infile.read().splitlines() lines = infile.read().splitlines()
if mode == 'release': if mode == 'release':
lines[1] = replace_one( lines[1] = replace_one(
lines[1], ':: Python interpreter.', lines[1], ':: Python interpreter.', ':: Python interpreter.'
':: Python interpreter.' ' (in opt mode so we use bundled .opt-1.pyc files)')
' (in opt mode so we use bundled .opt-1.pyc files)') lines[2] = replace_one(
lines[2] = replace_one( lines[2], 'dist\\\\python.exe ballisticacore_server.py',
lines[2], 'dist\\\\python.exe ballisticacore_server.py', 'dist\\\\python.exe -O ballisticacore_server.py')
'dist\\\\python.exe -O ballisticacore_server.py') else:
# In debug mode we use the bundled debug interpreter.
lines[2] = replace_one(
lines[2], 'dist\\\\python.exe ballisticacore_server.py',
'dist\\\\python_d.exe ballisticacore_server.py')
with open(outfilename, 'w') as outfile: with open(outfilename, 'w') as outfile:
outfile.write('\n'.join(lines) + '\n') outfile.write('\n'.join(lines) + '\n')
else: else: