Fix #444: win-scons include Visual Studio debug symbols

This commit is contained in:
2024-09-15 10:57:00 -05:00
committed by Celtic Minstrel
parent cc276a64db
commit 8a522bdcbf
5 changed files with 25 additions and 1 deletions

View File

@@ -80,6 +80,7 @@ if env['debug']:
env.Append(CCFLAGS=['-g','-O0'])
elif platform == 'win32':
env.Append(CCFLAGS=['/Zi', '/Od'])
env.Append(LINKFLAGS=['/DEBUG'])
# This command generates the header with git revision information
# NOTE: Changes made here must also be made in pkg/gitrev.sh!

View File

@@ -43,6 +43,9 @@ elif str(platform) == "posix":
"""))
boe = env.Program("#build/bin/Blades of Exile", game_sources + party_classes + common_sources)
debug_symbols = None
if str(platform) == "win32" and 'msvc' in env["TOOLS"] and env['debug']:
debug_symbols = boe[0].abspath.replace('.exe', '.pdb')
if str(platform) == "darwin":
boe_info = {
@@ -55,3 +58,5 @@ else:
boe_info = {}
env.Package(boe, install_dir, boe_info)
if debug_symbols is not None:
env.Install(install_dir, debug_symbols)

View File

@@ -27,6 +27,9 @@ elif str(platform) == "posix":
"""))
pced = env.Program("#build/bin/BoE Character Editor", pced_sources + party_classes + common_sources)
debug_symbols = None
if str(platform) == "win32" and 'msvc' in env["TOOLS"] and env['debug']:
debug_symbols = pced[0].abspath.replace('.exe', '.pdb')
if str(platform) == "darwin":
pced_info = {
@@ -39,3 +42,5 @@ else:
pced_info = {}
env.Package(pced, install_dir, pced_info)
if debug_symbols is not None:
env.Install(install_dir, debug_symbols)

View File

@@ -31,6 +31,9 @@ elif str(platform) == "posix":
"""))
scened = env.Program("#build/bin/BoE Scenario Editor", scened_sources + common_sources)
debug_symbols = None
if str(platform) == "win32" and 'msvc' in env["TOOLS"] and env['debug']:
debug_symbols = scened[0].abspath.replace('.exe', '.pdb')
if str(platform) == "darwin":
scened_info = {
@@ -43,3 +46,5 @@ else:
scened_info = {}
env.Package(scened, install_dir, scened_info)
if debug_symbols is not None:
env.Install(install_dir, debug_symbols)

View File

@@ -11,8 +11,14 @@ test_sources = Glob("""*.cpp""") + Split("""
#build/obj/scenedit/scen.fileio.cpp
""")
debug_symbols = None
if str(platform) == "win32" and 'msvc' in env["TOOLS"]:
test = env.Program("#build/bin/boe_test", party_classes + common_sources + test_sources, LINKFLAGS=f'/nologo /SUBSYSTEM:CONSOLE /MACHINE:X{arch_short}')
link_flags = f'/nologo /SUBSYSTEM:CONSOLE /MACHINE:X{arch_short}'
if env['debug']:
link_flags += ' /DEBUG'
test = env.Program("#build/bin/boe_test", party_classes + common_sources + test_sources, LINKFLAGS=link_flags)
if env['debug']:
debug_symbols = test[0].abspath.replace(".exe", ".pdb")
else:
test = env.Program("#build/bin/boe_test", test_sources + party_classes + common_sources)
@@ -23,6 +29,8 @@ def run_tests(env,target,source):
open(target[0].abspath,'w').write("PASSED\n")
env.Install("#build/test/", test)
if debug_symbols is not None:
env.Install("#build/test/", debug_symbols)
env.AlwaysBuild(env.Install("#build/test/", Dir("#test/files")))
env.AlwaysBuild(env.Install("#build/rsrc/", Dir("#rsrc/strings")))
env.Command("#build/test/junk/", '', 'mkdir "' + Dir("#build/test/junk").path + '"')