diff --git a/SConstruct b/SConstruct index 7ac549bd8..95fe241c2 100644 --- a/SConstruct +++ b/SConstruct @@ -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! diff --git a/src/game/SConscript b/src/game/SConscript index 2a17f2032..cd0998da4 100644 --- a/src/game/SConscript +++ b/src/game/SConscript @@ -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) diff --git a/src/pcedit/SConscript b/src/pcedit/SConscript index d71c4e14b..1f3b996f0 100644 --- a/src/pcedit/SConscript +++ b/src/pcedit/SConscript @@ -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) \ No newline at end of file diff --git a/src/scenedit/SConscript b/src/scenedit/SConscript index dd798ef3c..f10823315 100644 --- a/src/scenedit/SConscript +++ b/src/scenedit/SConscript @@ -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) \ No newline at end of file diff --git a/test/SConscript b/test/SConscript index 9ca3e3fb1..94be4c3cd 100644 --- a/test/SConscript +++ b/test/SConscript @@ -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 + '"')