From 50d8749b4d00159e8b26b48a82619acc0f23107e Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 29 May 2024 19:03:29 -0600 Subject: [PATCH 01/46] fix a link flag --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 231b5fdcf..aa2180c36 100644 --- a/SConstruct +++ b/SConstruct @@ -187,7 +187,7 @@ elif platform == "win32": if 'msvc' in env['TOOLS']: vcpkg_prefix = (os.environ['HOME'] if 'HOME' in os.environ else 'C:') + f'/vcpkg/installed/x{env["bits"]}-windows' env.Append( - LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup','/MACHINE:X86'], + LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], INCLUDEPATH=vcpkg_prefix + '/include', LIBPATH=vcpkg_prefix + '/lib', From 2fe8db1a0f9f9bf76123e593d3358829265bdf68 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 29 May 2024 19:22:44 -0600 Subject: [PATCH 02/46] 64-bit build --- .github/workflows/scripts/win/scons-build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scripts/win/scons-build.bat b/.github/workflows/scripts/win/scons-build.bat index 901b7ac1d..4e1b6b6a0 100644 --- a/.github/workflows/scripts/win/scons-build.bat +++ b/.github/workflows/scripts/win/scons-build.bat @@ -5,4 +5,4 @@ for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Micros call "%%i" x86_amd64 ) -scons +scons bits=64 From eef1318c5ab3351ee408c655647fc67f445166a9 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 29 May 2024 20:00:21 -0600 Subject: [PATCH 03/46] another hack to find weirdly named libraries --- SConstruct | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/SConstruct b/SConstruct index aa2180c36..819c4acdb 100644 --- a/SConstruct +++ b/SConstruct @@ -280,16 +280,17 @@ if not env.GetOption('clean'): print('zlib must be installed!') Exit(1) - def check_lib(lib, disp, suffixes=[], versions=[]): - if platform == "win32" and lib.startswith("boost"): - lib = "lib" + lib + def check_lib(lib, disp, suffixes=[], versions=[], msvc_versions=[]): if "mingw" in env["TOOLS"] and lib.startswith("sfml"): lib = "lib" + lib possible_names = [lib] if platform == "win32": if 'msvc' in env['TOOLS']: - vc_suffix = '-vc' + env['MSVC_VERSION'].replace('.','') - possible_names.append(lib + vc_suffix) + msvc_versions.append(env['MSVC_VERSION'].replace('.','')) + msvc_versions = list(set(msvc_versions)) + for version in msvc_versions: + vc_suffix = '-vc' + version + possible_names.append(lib + vc_suffix) n = len(possible_names) for i in range(n): for suff in suffixes: @@ -312,7 +313,8 @@ if not env.GetOption('clean'): print(" If you're sure it's installed, try passing INCLUDEPATH=...") Exit(1) - boost_versions = ['-1_54', '-1_55', '-1_56', '-1_57', '-1_58'] # This is a bit of a hack. :( + boost_versions = ['-1_84'] # This is a bit of a hack. :( + msvc_versions = ['140', '141', '142', '143'] # This is a new bit of a hack. :( bundled_libs = [] @@ -322,8 +324,8 @@ if not env.GetOption('clean'): check_header('boost/any.hpp', 'Boost.Any') check_header('boost/math_fwd.hpp', 'Boost.Math') check_header('boost/spirit/include/classic.hpp', 'Boost.Spirit.Classic') - check_lib('boost_system', 'Boost.System', ['-mt'], boost_versions) - check_lib('boost_filesystem', 'Boost.Filesystem', ['-mt'], boost_versions) + check_lib('boost_system', 'Boost.System', ['-mt'], boost_versions, msvc_versions) + check_lib('boost_filesystem', 'Boost.Filesystem', ['-mt'], boost_versions, msvc_versions) check_lib('sfml-system', 'SFML-system') check_lib('sfml-window', 'SFML-window') check_lib('sfml-audio', 'SFML-audio') From a4df5d3458622a557eb0a67dbe37275726480aea Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 6 Jun 2024 19:11:06 -0600 Subject: [PATCH 04/46] Fix handling VCRedistInstall.exe --- SConstruct | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 819c4acdb..91a5d9ee5 100644 --- a/SConstruct +++ b/SConstruct @@ -449,14 +449,15 @@ elif platform == "win32": break # Extra: Microsoft redistributable libraries installer if 'msvc' in env["TOOLS"]: - if path.exists("dep/VCRedistInstall.exe"): + if path.exists("deps/VCRedistInstall.exe"): env.Install("build/Blades of Exile/", "dep/VCRedistInstall.exe") else: print("WARNING: Cannot find installer for the MSVC redistributable libraries for your version of Visual Studio.") print("Please download it from Microsoft's website and place it at:") - print(" dep/VCRedistInstall.exe") + print(" deps/VCRedistInstall.exe") # Create it so its lack doesn't cause makensis to break # (Because the installer is an optional component.) + os.makedirs("build/Blades of Exile", exist_ok=True) open("build/Blades of Exile/VCRedistInstall.exe", 'w').close() if platform == "darwin": From a4ec85fc08073d3f2a96ef12f3bcaae533235675 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 29 May 2024 20:38:32 -0600 Subject: [PATCH 05/46] add src folders to win-scons include paths --- SConstruct | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 91a5d9ee5..9274fa678 100644 --- a/SConstruct +++ b/SConstruct @@ -185,7 +185,13 @@ if platform == "darwin": break elif platform == "win32": if 'msvc' in env['TOOLS']: - vcpkg_prefix = (os.environ['HOME'] if 'HOME' in os.environ else 'C:') + f'/vcpkg/installed/x{env["bits"]}-windows' + vcpkg_prefix = (os.environ['HOME'] if 'HOME' in os.environ else 'C:') + '/vcpkg/' + vcpkg_installed = vcpkg_prefix + 'installed/x{env["bits"]}-windows' + vcpkg_other_packages = Glob(vcpkg_prefix + f'packages/**x{env["bits"]}-windows') + vcpkg_other_includes = [d.get_abspath() + '\\include' for d in vcpkg_other_packages] + vcpkg_other_libs = [d.get_abspath() + '\\lib' for d in vcpkg_other_packages] + project_includes = ['src/' + dir for dir in filter(lambda dir: os.path.isdir('src/' + dir), os.listdir('src'))] + include_paths=[vcpkg_installed + '/include'] + vcpkg_other_includes + project_includes env.Append( LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], From f8d99fd347ff723755cc583dfb22f0c8ddb47487 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 6 Jun 2024 18:58:18 -0600 Subject: [PATCH 06/46] changes I don't remember --- SConstruct | 5 +++-- src/game/boe.menus.win.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/SConstruct b/SConstruct index 9274fa678..1a7ac31e8 100644 --- a/SConstruct +++ b/SConstruct @@ -186,12 +186,13 @@ if platform == "darwin": elif platform == "win32": if 'msvc' in env['TOOLS']: vcpkg_prefix = (os.environ['HOME'] if 'HOME' in os.environ else 'C:') + '/vcpkg/' - vcpkg_installed = vcpkg_prefix + 'installed/x{env["bits"]}-windows' + vcpkg_installed = vcpkg_prefix + f'installed/x{env["bits"]}-windows' vcpkg_other_packages = Glob(vcpkg_prefix + f'packages/**x{env["bits"]}-windows') vcpkg_other_includes = [d.get_abspath() + '\\include' for d in vcpkg_other_packages] vcpkg_other_libs = [d.get_abspath() + '\\lib' for d in vcpkg_other_packages] project_includes = ['src/' + dir for dir in filter(lambda dir: os.path.isdir('src/' + dir), os.listdir('src'))] - include_paths=[vcpkg_installed + '/include'] + vcpkg_other_includes + project_includes + include_paths=[vcpkg_installed + '/include'] + vcpkg_other_includes # + project_includes + print(include_paths) env.Append( LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], diff --git a/src/game/boe.menus.win.cpp b/src/game/boe.menus.win.cpp index 7e491de0b..7d7ca6956 100644 --- a/src/game/boe.menus.win.cpp +++ b/src/game/boe.menus.win.cpp @@ -4,13 +4,13 @@ #include #include #include "boeresource.h" -#include "universe.hpp" +#include "../universe/universe.hpp" #include "boe.party.hpp" #include "boe.infodlg.hpp" #include "boe.consts.hpp" #include "spell.hpp" -#include "winutil.hpp" -#include "menu_accel.win.hpp" +#include "../tools/winutil.hpp" +#include "../tools/menu_accel.win.hpp" // Include this last because some #defines in the Windows headers cause compile errors in my headers. // Fortunately they're on symbols not used in this file, so this should work. @@ -287,7 +287,7 @@ void showMenuBar() { DrawMenuBar(mainPtr.getSystemHandle()); } -#include "cursors.hpp" +#include "../tools/cursors.hpp" LRESULT CALLBACK menuProc(HWND handle, UINT message, WPARAM wParam, LPARAM lParam) { MSG msg = {handle, message, wParam, lParam}; @@ -313,7 +313,7 @@ LRESULT CALLBACK menuProc(HWND handle, UINT message, WPARAM wParam, LPARAM lPara return CallWindowProc(reinterpret_cast(mainProc), handle, message, wParam, lParam); } -#include "fileio.hpp" +#include "../fileio/fileio.hpp" #include "boe.graphics.hpp" #include "boe.actions.hpp" #include "boe.fileio.hpp" From f462f8a77f20d3565039236176355a54dd7081b8 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 6 Jun 2024 19:30:43 -0600 Subject: [PATCH 07/46] don't comment the thing --- SConstruct | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 1a7ac31e8..41effcf57 100644 --- a/SConstruct +++ b/SConstruct @@ -191,8 +191,7 @@ elif platform == "win32": vcpkg_other_includes = [d.get_abspath() + '\\include' for d in vcpkg_other_packages] vcpkg_other_libs = [d.get_abspath() + '\\lib' for d in vcpkg_other_packages] project_includes = ['src/' + dir for dir in filter(lambda dir: os.path.isdir('src/' + dir), os.listdir('src'))] - include_paths=[vcpkg_installed + '/include'] + vcpkg_other_includes # + project_includes - print(include_paths) + include_paths=[vcpkg_installed + '/include'] + vcpkg_other_includes + project_includes env.Append( LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], From 4ef0f46d5b0e6d76c679dc7cd8bd86327f703446 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 6 Jun 2024 19:34:55 -0600 Subject: [PATCH 08/46] use path.join --- SConstruct | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/SConstruct b/SConstruct index 41effcf57..9a7588037 100644 --- a/SConstruct +++ b/SConstruct @@ -185,18 +185,18 @@ if platform == "darwin": break elif platform == "win32": if 'msvc' in env['TOOLS']: - vcpkg_prefix = (os.environ['HOME'] if 'HOME' in os.environ else 'C:') + '/vcpkg/' - vcpkg_installed = vcpkg_prefix + f'installed/x{env["bits"]}-windows' - vcpkg_other_packages = Glob(vcpkg_prefix + f'packages/**x{env["bits"]}-windows') - vcpkg_other_includes = [d.get_abspath() + '\\include' for d in vcpkg_other_packages] - vcpkg_other_libs = [d.get_abspath() + '\\lib' for d in vcpkg_other_packages] - project_includes = ['src/' + dir for dir in filter(lambda dir: os.path.isdir('src/' + dir), os.listdir('src'))] - include_paths=[vcpkg_installed + '/include'] + vcpkg_other_includes + project_includes + vcpkg_prefix = path.join((os.environ['HOME'] if 'HOME' in os.environ else 'C:'), 'vcpkg') + vcpkg_installed = path.join(vcpkg_prefix, f'installed/x{env["bits"]}-windows') + vcpkg_other_packages = Glob(path.join(vcpkg_prefix, f'packages/**x{env["bits"]}-windows')) + vcpkg_other_includes = [path.join(d.get_abspath(), 'include') for d in vcpkg_other_packages] + vcpkg_other_libs = [path.join(d.get_abspath(), 'lib') for d in vcpkg_other_packages] + project_includes = [path.join('src', dir) for dir in filter(lambda dir: os.path.isdir(path.join('src', dir)), os.listdir('src'))] + include_paths=[path.join(vcpkg_installed, 'include')] + vcpkg_other_includes + project_includes env.Append( LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], - INCLUDEPATH=vcpkg_prefix + '/include', - LIBPATH=vcpkg_prefix + '/lib', + INCLUDEPATH=path.join(vcpkg_prefix, 'include'), + LIBPATH=path.join(vcpkg_prefix, 'lib'), LIBS=Split(""" kernel32 user32 From ae2e8c792b702fed0e5b27d45a5987b77c4a681c Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 29 May 2024 21:04:55 -0600 Subject: [PATCH 09/46] more weird library suffixes --- SConstruct | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 9a7588037..a7f2bbf84 100644 --- a/SConstruct +++ b/SConstruct @@ -321,6 +321,7 @@ if not env.GetOption('clean'): boost_versions = ['-1_84'] # This is a bit of a hack. :( msvc_versions = ['140', '141', '142', '143'] # This is a new bit of a hack. :( + suffixes = ['-mt', '-mt-x64', '-mt-x32'] bundled_libs = [] @@ -330,8 +331,8 @@ if not env.GetOption('clean'): check_header('boost/any.hpp', 'Boost.Any') check_header('boost/math_fwd.hpp', 'Boost.Math') check_header('boost/spirit/include/classic.hpp', 'Boost.Spirit.Classic') - check_lib('boost_system', 'Boost.System', ['-mt'], boost_versions, msvc_versions) - check_lib('boost_filesystem', 'Boost.Filesystem', ['-mt'], boost_versions, msvc_versions) + check_lib('boost_system', 'Boost.System', suffixes, boost_versions, msvc_versions) + check_lib('boost_filesystem', 'Boost.Filesystem', suffixes, boost_versions, msvc_versions) check_lib('sfml-system', 'SFML-system') check_lib('sfml-window', 'SFML-window') check_lib('sfml-audio', 'SFML-audio') From d7c16700de2d6425b7bad07f91d97cf72ed7b0a3 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 29 May 2024 21:27:25 -0600 Subject: [PATCH 10/46] fix old python syntax in an SConscript file --- pkg/win/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/win/SConscript b/pkg/win/SConscript index 79e6b0725..f76852e5d 100644 --- a/pkg/win/SConscript +++ b/pkg/win/SConscript @@ -4,7 +4,7 @@ import os.path as path Import("env platform") if str(platform) != "win32": - print "Error: Building for", str(platform), "but trying to create a Windows installer package" + print(f"Error: Building for {platform}, but trying to create a Windows installer package") env.Depends("data.nsi", ["gen-data.py", "#build/Blades of Exile/data"]) From 08c410c1e170d2d10da0c9804446b76ef3970545 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Fri, 7 Jun 2024 09:07:10 -0600 Subject: [PATCH 11/46] find vcpkg libraries and headers --- SConstruct | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index a7f2bbf84..698708c08 100644 --- a/SConstruct +++ b/SConstruct @@ -186,8 +186,8 @@ if platform == "darwin": elif platform == "win32": if 'msvc' in env['TOOLS']: vcpkg_prefix = path.join((os.environ['HOME'] if 'HOME' in os.environ else 'C:'), 'vcpkg') - vcpkg_installed = path.join(vcpkg_prefix, f'installed/x{env["bits"]}-windows') - vcpkg_other_packages = Glob(path.join(vcpkg_prefix, f'packages/**x{env["bits"]}-windows')) + vcpkg_installed = path.join(vcpkg_prefix, 'installed', f'x{env["bits"]}-windows') + vcpkg_other_packages = Glob(path.join(vcpkg_prefix, 'packages', f'**x{env["bits"]}-windows')) vcpkg_other_includes = [path.join(d.get_abspath(), 'include') for d in vcpkg_other_packages] vcpkg_other_libs = [path.join(d.get_abspath(), 'lib') for d in vcpkg_other_packages] project_includes = [path.join('src', dir) for dir in filter(lambda dir: os.path.isdir(path.join('src', dir)), os.listdir('src'))] @@ -195,8 +195,9 @@ elif platform == "win32": env.Append( LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], - INCLUDEPATH=path.join(vcpkg_prefix, 'include'), - LIBPATH=path.join(vcpkg_prefix, 'lib'), + CPPPATH=[path.join(vcpkg_installed, 'include')], + INCLUDEPATH=include_paths, + LIBPATH=[path.join(vcpkg_prefix, 'lib')] + vcpkg_other_libs, LIBS=Split(""" kernel32 user32 From b46d260ce5e057e7f1114ae0bb7b29ee0945ff9f Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Fri, 7 Jun 2024 09:35:14 -0600 Subject: [PATCH 12/46] add icon dir to windows include paths --- SConstruct | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SConstruct b/SConstruct index 698708c08..0a1a6265c 100644 --- a/SConstruct +++ b/SConstruct @@ -372,6 +372,8 @@ env.Append(CPPDEFINES=["TIXML_USE_TICPP"]) if platform == "win32": # For the *resource.h headers env.Append(CPPPATH=["#rsrc/menus"]) + # Icons + env.Append(CPPPATH=["#rsrc/icons/win"]) if platform == "darwin": env.Append(LIBS=Split(""" From bc998dcd6ebd96ca72913eeb5e51d2e84b4d7b17 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Fri, 7 Jun 2024 09:55:49 -0600 Subject: [PATCH 13/46] more include paths --- SConstruct | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index 0a1a6265c..5f350ff99 100644 --- a/SConstruct +++ b/SConstruct @@ -190,13 +190,16 @@ elif platform == "win32": vcpkg_other_packages = Glob(path.join(vcpkg_prefix, 'packages', f'**x{env["bits"]}-windows')) vcpkg_other_includes = [path.join(d.get_abspath(), 'include') for d in vcpkg_other_packages] vcpkg_other_libs = [path.join(d.get_abspath(), 'lib') for d in vcpkg_other_packages] - project_includes = [path.join('src', dir) for dir in filter(lambda dir: os.path.isdir(path.join('src', dir)), os.listdir('src'))] + project_includes = [] + for (root, dirs, files) in os.walk('src'): + project_includes.append(path.join(os.getcwd(), root)) + + # project_includes = [path.join('src', dir) for dir in filter(lambda dir: os.path.isdir(path.join('src', dir)), os.listdir('src'))] include_paths=[path.join(vcpkg_installed, 'include')] + vcpkg_other_includes + project_includes env.Append( LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], - CPPPATH=[path.join(vcpkg_installed, 'include')], - INCLUDEPATH=include_paths, + CPPPATH=include_paths, LIBPATH=[path.join(vcpkg_prefix, 'lib')] + vcpkg_other_libs, LIBS=Split(""" kernel32 From 2cce46ec0205c0f41fe32e9b75fd526f5e1e7509 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Fri, 7 Jun 2024 09:55:55 -0600 Subject: [PATCH 14/46] include string --- src/spell.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/spell.hpp b/src/spell.hpp index 648e8e2b5..aaa203279 100644 --- a/src/spell.hpp +++ b/src/spell.hpp @@ -10,6 +10,7 @@ #define BoE_DATA_SPELL_HPP #include +#include #include "skills_traits.hpp" // This controls how a spell is cast in combat; YES means it's the same as in town, IMMED means it has a special implementation in town, and TARGET / FANCY both mean it requires target selection. From 5aa7f76425fc91eaf9926680cb9eddc3ea93a112 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Fri, 7 Jun 2024 09:59:46 -0600 Subject: [PATCH 15/46] remove non-recursive os.listdir line --- SConstruct | 1 - 1 file changed, 1 deletion(-) diff --git a/SConstruct b/SConstruct index 5f350ff99..0229fdeb9 100644 --- a/SConstruct +++ b/SConstruct @@ -194,7 +194,6 @@ elif platform == "win32": for (root, dirs, files) in os.walk('src'): project_includes.append(path.join(os.getcwd(), root)) - # project_includes = [path.join('src', dir) for dir in filter(lambda dir: os.path.isdir(path.join('src', dir)), os.listdir('src'))] include_paths=[path.join(vcpkg_installed, 'include')] + vcpkg_other_includes + project_includes env.Append( LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], From eec7396daa09e55f248d6d7932fb0a2db1ca4f9e Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Fri, 7 Jun 2024 10:22:16 -0600 Subject: [PATCH 16/46] remove bad lib paths --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 0229fdeb9..b94bb8807 100644 --- a/SConstruct +++ b/SConstruct @@ -199,7 +199,7 @@ elif platform == "win32": LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], CPPPATH=include_paths, - LIBPATH=[path.join(vcpkg_prefix, 'lib')] + vcpkg_other_libs, + LIBPATH=[path.join(vcpkg_installed, 'lib')], LIBS=Split(""" kernel32 user32 From bc17c0141cd6d6ca84545a53d5e18ff790b40239 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Fri, 7 Jun 2024 10:22:35 -0600 Subject: [PATCH 17/46] tools build with env["bits"] --- test/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/SConscript b/test/SConscript index 9ea6b2706..d75947438 100644 --- a/test/SConscript +++ b/test/SConscript @@ -11,7 +11,7 @@ test_sources = Glob("""*.cpp""") + Split(""" """) if str(platform) == "win32" and 'msvc' in env["TOOLS"]: - test = env.Program("#build/bin/boe_test", party_classes + common_sources + test_sources, LINKFLAGS='/nologo /SUBSYSTEM:CONSOLE /MACHINE:X86') + test = env.Program("#build/bin/boe_test", party_classes + common_sources + test_sources, LINKFLAGS=f'/nologo /SUBSYSTEM:CONSOLE /MACHINE:X{env["bits"]}') else: test = env.Program("#build/bin/boe_test", test_sources + party_classes + common_sources) From 1ef7df0f3e64c5d94fc5537fc2d7324854cf0a11 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 11:06:05 -0600 Subject: [PATCH 18/46] debug vcpkg path --- .github/workflows/ci.yml | 8 ++++++++ SConstruct | 2 ++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e0a9d8b3..f3e9a8488 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,6 +151,14 @@ run: '${{ github.workspace }}\.github\workflows\scripts\win\install-deps.bat x64', working-directory: proj/vs2017 }, + { + name: debug lib locations, + run: 'dir C:/vcpkg' + }, + { + name: debug lib locations, + run: 'dir C:/vcpkg/installed/x64-windows' + }, { name: build and unit test, run: '.\.github\workflows\scripts\win\scons-build.bat' diff --git a/SConstruct b/SConstruct index b94bb8807..f0a912fb6 100644 --- a/SConstruct +++ b/SConstruct @@ -194,6 +194,8 @@ elif platform == "win32": for (root, dirs, files) in os.walk('src'): project_includes.append(path.join(os.getcwd(), root)) + print([path.join(vcpkg_installed, 'lib')]) + include_paths=[path.join(vcpkg_installed, 'include')] + vcpkg_other_includes + project_includes env.Append( LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], From 089822ec8892fa7b1551590f0797c3d166bec15d Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 11:21:49 -0600 Subject: [PATCH 19/46] debug more --- .github/workflows/ci.yml | 2 +- .github/workflows/scripts/win/scons-build.bat | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3e9a8488..b94d98d1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,7 +157,7 @@ }, { name: debug lib locations, - run: 'dir C:/vcpkg/installed/x64-windows' + run: 'dir C:/vcpkg/installed/x64-windows/lib' }, { name: build and unit test, diff --git a/.github/workflows/scripts/win/scons-build.bat b/.github/workflows/scripts/win/scons-build.bat index 4e1b6b6a0..9640b4924 100644 --- a/.github/workflows/scripts/win/scons-build.bat +++ b/.github/workflows/scripts/win/scons-build.bat @@ -2,6 +2,7 @@ setlocal enabledelayedexpansion for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find **/Auxiliary/Build/vcvarsall.bat`) do ( + @echo "%%i" call "%%i" x86_amd64 ) From a9185fe128d96108f1125c59b61499f22240c04c Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 11:37:56 -0600 Subject: [PATCH 20/46] hard-code vcvarsall.bat path, with a note --- .github/workflows/scripts/win/scons-build.bat | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/win/scons-build.bat b/.github/workflows/scripts/win/scons-build.bat index 9640b4924..ecee030c4 100644 --- a/.github/workflows/scripts/win/scons-build.bat +++ b/.github/workflows/scripts/win/scons-build.bat @@ -1,9 +1,15 @@ setlocal enabledelayedexpansion -for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find **/Auxiliary/Build/vcvarsall.bat`) do ( - @echo "%%i" - call "%%i" x86_amd64 -) +REM This for loop takes a long time to find vcvarsall.bat, +REM so I hard-coded the path in. When Github Runner versions change, +REM the for loop might be needed again to discover the right path. + +REM for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find **/Auxiliary/Build/vcvarsall.bat`) do ( +REM @echo "%%i" +REM call "%%i" x86_amd64 +REM ) + +call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 scons bits=64 From f4e3fc26c03bd8ad63009d403b87fb6316ad2d7b Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 11:43:33 -0600 Subject: [PATCH 21/46] try win-scons without caching --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b94d98d1d..0230ffdbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,13 +130,13 @@ VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" }, steps: [ - { - name: Export GitHub Actions cache environment variables, - uses: actions/github-script@v7, - with: { - script: "core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');" - } - }, + # { + # name: Export GitHub Actions cache environment variables, + # uses: actions/github-script@v7, + # with: { + # script: "core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');" + # } + # }, { name: checkout, uses: actions/checkout@v2, @@ -153,7 +153,7 @@ }, { name: debug lib locations, - run: 'dir C:/vcpkg' + run: 'dir C:/vcpkg/installed/x64-windows' }, { name: debug lib locations, From 5c4375434e1df9ab8982ff9d5d02e47303e2e0f9 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 12:21:50 -0600 Subject: [PATCH 22/46] no binary caching (TEMPORARY) --- .github/workflows/scripts/win/install-deps.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scripts/win/install-deps.bat b/.github/workflows/scripts/win/install-deps.bat index 00f16ee7f..92d5df8d3 100644 --- a/.github/workflows/scripts/win/install-deps.bat +++ b/.github/workflows/scripts/win/install-deps.bat @@ -1,2 +1,2 @@ -vcpkg install --feature-flags=manifests,binarycaching --triplet %1-windows +vcpkg install --feature-flags=manifests --triplet %1-windows From 7e6b1405170287b185734cf3d2ac15ac919e3a28 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 12:23:40 -0600 Subject: [PATCH 23/46] disable another thing --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0230ffdbe..105d0ed6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,7 +127,7 @@ win-scons: { runs-on: windows-2019, env: { - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + #VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" }, steps: [ # { From 434ceea9bb6fb2f12c065cdab349b8f822a55d8d Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 12:34:16 -0600 Subject: [PATCH 24/46] fix C: path --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index f0a912fb6..d66785400 100644 --- a/SConstruct +++ b/SConstruct @@ -185,7 +185,7 @@ if platform == "darwin": break elif platform == "win32": if 'msvc' in env['TOOLS']: - vcpkg_prefix = path.join((os.environ['HOME'] if 'HOME' in os.environ else 'C:'), 'vcpkg') + vcpkg_prefix = path.join((os.environ['HOME'] if 'HOME' in os.environ else 'C:/'), 'vcpkg') vcpkg_installed = path.join(vcpkg_prefix, 'installed', f'x{env["bits"]}-windows') vcpkg_other_packages = Glob(path.join(vcpkg_prefix, 'packages', f'**x{env["bits"]}-windows')) vcpkg_other_includes = [path.join(d.get_abspath(), 'include') for d in vcpkg_other_packages] From 84eaa09b9a7d86a3d0d8a7deaeac0d482adc4090 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 12:34:34 -0600 Subject: [PATCH 25/46] Revert "disable another thing" This reverts commit 7e6b1405170287b185734cf3d2ac15ac919e3a28. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 105d0ed6e..0230ffdbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,7 +127,7 @@ win-scons: { runs-on: windows-2019, env: { - #VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" }, steps: [ # { From 26cd6a09703df91b7e2b74fac77e0cfaced5cad2 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 12:34:52 -0600 Subject: [PATCH 26/46] Revert "no binary caching (TEMPORARY)" This reverts commit 5c4375434e1df9ab8982ff9d5d02e47303e2e0f9. --- .github/workflows/scripts/win/install-deps.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scripts/win/install-deps.bat b/.github/workflows/scripts/win/install-deps.bat index 92d5df8d3..00f16ee7f 100644 --- a/.github/workflows/scripts/win/install-deps.bat +++ b/.github/workflows/scripts/win/install-deps.bat @@ -1,2 +1,2 @@ -vcpkg install --feature-flags=manifests --triplet %1-windows +vcpkg install --feature-flags=manifests,binarycaching --triplet %1-windows From c44da1494f1fd56cb9c9f52580d6dfa890c451ba Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 12:35:11 -0600 Subject: [PATCH 27/46] Revert "try win-scons without caching" This reverts commit f4e3fc26c03bd8ad63009d403b87fb6316ad2d7b. --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0230ffdbe..b94d98d1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,13 +130,13 @@ VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" }, steps: [ - # { - # name: Export GitHub Actions cache environment variables, - # uses: actions/github-script@v7, - # with: { - # script: "core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');" - # } - # }, + { + name: Export GitHub Actions cache environment variables, + uses: actions/github-script@v7, + with: { + script: "core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');" + } + }, { name: checkout, uses: actions/checkout@v2, @@ -153,7 +153,7 @@ }, { name: debug lib locations, - run: 'dir C:/vcpkg/installed/x64-windows' + run: 'dir C:/vcpkg' }, { name: debug lib locations, From 722a18342cb8734c283195d5bc5554b0fb186305 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 12:44:48 -0600 Subject: [PATCH 28/46] debug print other lib folders --- .github/workflows/ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b94d98d1d..c4a04a9f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,16 +153,14 @@ }, { name: debug lib locations, - run: 'dir C:/vcpkg' - }, - { - name: debug lib locations, - run: 'dir C:/vcpkg/installed/x64-windows/lib' + run: 'ls "C:/vcpkg/packages/**/lib"', + shell: bash }, { name: build and unit test, run: '.\.github\workflows\scripts\win\scons-build.bat' - } + }, + ] }, # win-mingw: { From 65079ef633a82f923d6064c5c87ab24fb5ed5f6c Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 12:45:08 -0600 Subject: [PATCH 29/46] use a backslash to match --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index d66785400..03db9a8e6 100644 --- a/SConstruct +++ b/SConstruct @@ -185,7 +185,7 @@ if platform == "darwin": break elif platform == "win32": if 'msvc' in env['TOOLS']: - vcpkg_prefix = path.join((os.environ['HOME'] if 'HOME' in os.environ else 'C:/'), 'vcpkg') + vcpkg_prefix = path.join((os.environ['HOME'] if 'HOME' in os.environ else 'C:\\'), 'vcpkg') vcpkg_installed = path.join(vcpkg_prefix, 'installed', f'x{env["bits"]}-windows') vcpkg_other_packages = Glob(path.join(vcpkg_prefix, 'packages', f'**x{env["bits"]}-windows')) vcpkg_other_includes = [path.join(d.get_abspath(), 'include') for d in vcpkg_other_packages] From 2e4cdf0fc54cd1e0876ca234b5628659c23d57b0 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 12:45:16 -0600 Subject: [PATCH 30/46] pass in other lib paths --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 03db9a8e6..b790cb7be 100644 --- a/SConstruct +++ b/SConstruct @@ -201,7 +201,7 @@ elif platform == "win32": LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], CPPPATH=include_paths, - LIBPATH=[path.join(vcpkg_installed, 'lib')], + LIBPATH=[path.join(vcpkg_installed, 'lib')] + vcpkg_other_libs, LIBS=Split(""" kernel32 user32 From a3e0dcc5fd7772c9d3fb8ecfe9ef823bf0349681 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 12:48:16 -0600 Subject: [PATCH 31/46] remove debug that didn't work --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4a04a9f7..5cfab03d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,11 +151,6 @@ run: '${{ github.workspace }}\.github\workflows\scripts\win\install-deps.bat x64', working-directory: proj/vs2017 }, - { - name: debug lib locations, - run: 'ls "C:/vcpkg/packages/**/lib"', - shell: bash - }, { name: build and unit test, run: '.\.github\workflows\scripts\win\scons-build.bat' From 068aa45a354abe3258ea12edc64c154579ad3bd2 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 29 May 2024 21:27:25 -0600 Subject: [PATCH 32/46] Fix more old python syntax --- pkg/win/gen-data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/win/gen-data.py b/pkg/win/gen-data.py index 0f1bfa352..3f442b63d 100644 --- a/pkg/win/gen-data.py +++ b/pkg/win/gen-data.py @@ -24,11 +24,11 @@ } for path, pattern in files.items(): - print 'SetOutPath', '"' + makepath("$INSTDIR/" + path + '/') + '"' + print(f'SetOutPath "{makepath("$INSTDIR/" + path + '/')}"') if type(pattern) == list: check_files = [root + '/' + path + '/' + x for x in pattern] else: check_files = glob(makepath(root + '/' + path + '/' + pattern)) for fname in check_files: - print 'File', '"' + makepath(fname.replace(root, '${RELEASE_DIR}')) + '"' + print(f'File "{makepath(fname.replace(root, '${RELEASE_DIR}'))}"') From 5040b266614196bd1874e3f2bea2e1ca0ebb7858 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 13:31:14 -0600 Subject: [PATCH 33/46] fix syntax again --- pkg/win/gen-data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/win/gen-data.py b/pkg/win/gen-data.py index 3f442b63d..79cb1df94 100644 --- a/pkg/win/gen-data.py +++ b/pkg/win/gen-data.py @@ -30,5 +30,5 @@ else: check_files = glob(makepath(root + '/' + path + '/' + pattern)) for fname in check_files: - print(f'File "{makepath(fname.replace(root, '${RELEASE_DIR}'))}"') + print(f'File "{makepath(fname.replace(root, "${RELEASE_DIR}"))}"') From 84f4860b5bf4ef279258f686d137545d8b8f5536 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 14:02:09 -0600 Subject: [PATCH 34/46] Revert "fix syntax again" This reverts commit 5040b266614196bd1874e3f2bea2e1ca0ebb7858. --- pkg/win/gen-data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/win/gen-data.py b/pkg/win/gen-data.py index 79cb1df94..3f442b63d 100644 --- a/pkg/win/gen-data.py +++ b/pkg/win/gen-data.py @@ -30,5 +30,5 @@ else: check_files = glob(makepath(root + '/' + path + '/' + pattern)) for fname in check_files: - print(f'File "{makepath(fname.replace(root, "${RELEASE_DIR}"))}"') + print(f'File "{makepath(fname.replace(root, '${RELEASE_DIR}'))}"') From 8c4b8ca37be589e5d64e2c5afca6317e2a173f29 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 14:02:21 -0600 Subject: [PATCH 35/46] Revert "Fix more old python syntax" This reverts commit 068aa45a354abe3258ea12edc64c154579ad3bd2. --- pkg/win/gen-data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/win/gen-data.py b/pkg/win/gen-data.py index 3f442b63d..0f1bfa352 100644 --- a/pkg/win/gen-data.py +++ b/pkg/win/gen-data.py @@ -24,11 +24,11 @@ } for path, pattern in files.items(): - print(f'SetOutPath "{makepath("$INSTDIR/" + path + '/')}"') + print 'SetOutPath', '"' + makepath("$INSTDIR/" + path + '/') + '"' if type(pattern) == list: check_files = [root + '/' + path + '/' + x for x in pattern] else: check_files = glob(makepath(root + '/' + path + '/' + pattern)) for fname in check_files: - print(f'File "{makepath(fname.replace(root, '${RELEASE_DIR}'))}"') + print 'File', '"' + makepath(fname.replace(root, '${RELEASE_DIR}')) + '"' From 9a67136e944ba236f8506a4acd9d47d0df9001a4 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 14:04:22 -0600 Subject: [PATCH 36/46] fix syntax without trying to use f-strings --- pkg/win/gen-data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/win/gen-data.py b/pkg/win/gen-data.py index 0f1bfa352..d241aea24 100644 --- a/pkg/win/gen-data.py +++ b/pkg/win/gen-data.py @@ -24,11 +24,11 @@ } for path, pattern in files.items(): - print 'SetOutPath', '"' + makepath("$INSTDIR/" + path + '/') + '"' + print('SetOutPath "' + makepath('$INSTDIR/' + path + '/') + '"') if type(pattern) == list: check_files = [root + '/' + path + '/' + x for x in pattern] else: check_files = glob(makepath(root + '/' + path + '/' + pattern)) for fname in check_files: - print 'File', '"' + makepath(fname.replace(root, '${RELEASE_DIR}')) + '"' + print('File "' + makepath(fname.replace(root, '${RELEASE_DIR}')) + '"') From c1fc69a6b8f1c3c19f1d76e2a8c98a4cd3497fd8 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 15:03:42 -0600 Subject: [PATCH 37/46] disable windows installer packaging for now --- SConstruct | 2 -- 1 file changed, 2 deletions(-) diff --git a/SConstruct b/SConstruct index b790cb7be..de00d4d7a 100644 --- a/SConstruct +++ b/SConstruct @@ -194,8 +194,6 @@ elif platform == "win32": for (root, dirs, files) in os.walk('src'): project_includes.append(path.join(os.getcwd(), root)) - print([path.join(vcpkg_installed, 'lib')]) - include_paths=[path.join(vcpkg_installed, 'include')] + vcpkg_other_includes + project_includes env.Append( LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], From 276b91ae24526eb5afdbe477dfe301b97b4ea367 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 15:12:05 -0600 Subject: [PATCH 38/46] actually disable windows installer --- SConstruct | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index de00d4d7a..b676f9618 100644 --- a/SConstruct +++ b/SConstruct @@ -475,9 +475,9 @@ elif platform == "win32": if platform == "darwin": env.VariantDir("#build/pkg", "pkg/mac") SConscript("build/pkg/SConscript") -elif platform == "win32" and subprocess.call(['where', '/Q', 'makensis']) == 0: - env.VariantDir("#build/pkg", "pkg/win") - SConscript("build/pkg/SConscript") +#elif platform == "win32" and subprocess.call(['where', '/Q', 'makensis']) == 0: +# env.VariantDir("#build/pkg", "pkg/win") +# SConscript("build/pkg/SConscript") # Cleanup From 625aac3360bdec116a6d75466c7e4e6c6f071186 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 16:43:27 -0600 Subject: [PATCH 39/46] more bundled libs on windows --- SConstruct | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index b676f9618..33d284cfd 100644 --- a/SConstruct +++ b/SConstruct @@ -278,6 +278,8 @@ env.Append(CPPPATH=Split(""" env['CONFIGUREDIR'] = '#build/conf' env['CONFIGURELOG'] = '#build/conf/config.log' + +bundled_libs = [] if not env.GetOption('clean'): conf = Configure(env) @@ -325,7 +327,6 @@ if not env.GetOption('clean'): boost_versions = ['-1_84'] # This is a bit of a hack. :( msvc_versions = ['140', '141', '142', '143'] # This is a new bit of a hack. :( suffixes = ['-mt', '-mt-x64', '-mt-x32'] - bundled_libs = [] check_header('boost/lexical_cast.hpp', 'Boost.LexicalCast') @@ -436,7 +437,7 @@ if platform == "darwin": binary = path.join(install_dir, targ + '.app', 'Contents/MacOS', targ) env.Command(Dir(target_dir), binary, [Delete(target_dir), bundle_libraries_for]) elif platform == "win32": - bundled_libs = Split(""" + bundled_libs += Split(""" libsndfile-1 openal32 sfml-audio-2 @@ -444,6 +445,15 @@ elif platform == "win32": sfml-system-2 sfml-window-2 zlib1 + freetype + vorbis + vorbisfile + vorbisenc + ogg + FLAC + bz2 + brotlidec + brotlicommon """) target_dirs = ["#build/Blades of Exile", "#build/test"] for lib in bundled_libs: From 951c11668a43ff219d14c77dc5ee338bdb8a30bd Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 16:44:06 -0600 Subject: [PATCH 40/46] add bin folders for windows installation to find dlls --- SConstruct | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 33d284cfd..5f531de3d 100644 --- a/SConstruct +++ b/SConstruct @@ -189,7 +189,11 @@ elif platform == "win32": vcpkg_installed = path.join(vcpkg_prefix, 'installed', f'x{env["bits"]}-windows') vcpkg_other_packages = Glob(path.join(vcpkg_prefix, 'packages', f'**x{env["bits"]}-windows')) vcpkg_other_includes = [path.join(d.get_abspath(), 'include') for d in vcpkg_other_packages] + vcpkg_other_includes = list(filter(path.exists, vcpkg_other_includes)) vcpkg_other_libs = [path.join(d.get_abspath(), 'lib') for d in vcpkg_other_packages] + vcpkg_other_libs = list(filter(path.exists, vcpkg_other_libs)) + vcpkg_other_bins = [path.join(d.get_abspath(), 'bin') for d in vcpkg_other_packages] + vcpkg_other_bins = list(filter(path.exists, vcpkg_other_bins)) project_includes = [] for (root, dirs, files) in os.walk('src'): project_includes.append(path.join(os.getcwd(), root)) @@ -199,7 +203,7 @@ elif platform == "win32": LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], CPPPATH=include_paths, - LIBPATH=[path.join(vcpkg_installed, 'lib')] + vcpkg_other_libs, + LIBPATH=[path.join(vcpkg_installed, 'lib')] + vcpkg_other_libs + vcpkg_other_bins, LIBS=Split(""" kernel32 user32 From 4400b1b8a7db0aa44b1f5faa410c356c12f53d50 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 18:17:57 -0600 Subject: [PATCH 41/46] fix CheckLib stuff --- SConstruct | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/SConstruct b/SConstruct index 5f531de3d..050040b06 100644 --- a/SConstruct +++ b/SConstruct @@ -301,11 +301,9 @@ if not env.GetOption('clean'): possible_names = [lib] if platform == "win32": if 'msvc' in env['TOOLS']: - msvc_versions.append(env['MSVC_VERSION'].replace('.','')) - msvc_versions = list(set(msvc_versions)) - for version in msvc_versions: - vc_suffix = '-vc' + version - possible_names.append(lib + vc_suffix) + msvc_version = env['MSVC_VERSION'].replace('.','') + vc_suffix = '-vc' + msvc_version + possible_names.append(lib + vc_suffix) n = len(possible_names) for i in range(n): for suff in suffixes: @@ -329,8 +327,7 @@ if not env.GetOption('clean'): Exit(1) boost_versions = ['-1_84'] # This is a bit of a hack. :( - msvc_versions = ['140', '141', '142', '143'] # This is a new bit of a hack. :( - suffixes = ['-mt', '-mt-x64', '-mt-x32'] + suffixes = ['-mt', f'-mt-x{env["bits"]}'] check_header('boost/lexical_cast.hpp', 'Boost.LexicalCast') @@ -339,8 +336,8 @@ if not env.GetOption('clean'): check_header('boost/any.hpp', 'Boost.Any') check_header('boost/math_fwd.hpp', 'Boost.Math') check_header('boost/spirit/include/classic.hpp', 'Boost.Spirit.Classic') - check_lib('boost_system', 'Boost.System', suffixes, boost_versions, msvc_versions) - check_lib('boost_filesystem', 'Boost.Filesystem', suffixes, boost_versions, msvc_versions) + check_lib('boost_system', 'Boost.System', suffixes, boost_versions) + check_lib('boost_filesystem', 'Boost.Filesystem', suffixes, boost_versions) check_lib('sfml-system', 'SFML-system') check_lib('sfml-window', 'SFML-window') check_lib('sfml-audio', 'SFML-audio') From 8925494c50a8b3dde53ba361de33461195a5dde8 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 19:18:59 -0600 Subject: [PATCH 42/46] revert relative include paths --- src/game/boe.menus.win.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/boe.menus.win.cpp b/src/game/boe.menus.win.cpp index 7d7ca6956..7e491de0b 100644 --- a/src/game/boe.menus.win.cpp +++ b/src/game/boe.menus.win.cpp @@ -4,13 +4,13 @@ #include #include #include "boeresource.h" -#include "../universe/universe.hpp" +#include "universe.hpp" #include "boe.party.hpp" #include "boe.infodlg.hpp" #include "boe.consts.hpp" #include "spell.hpp" -#include "../tools/winutil.hpp" -#include "../tools/menu_accel.win.hpp" +#include "winutil.hpp" +#include "menu_accel.win.hpp" // Include this last because some #defines in the Windows headers cause compile errors in my headers. // Fortunately they're on symbols not used in this file, so this should work. @@ -287,7 +287,7 @@ void showMenuBar() { DrawMenuBar(mainPtr.getSystemHandle()); } -#include "../tools/cursors.hpp" +#include "cursors.hpp" LRESULT CALLBACK menuProc(HWND handle, UINT message, WPARAM wParam, LPARAM lParam) { MSG msg = {handle, message, wParam, lParam}; @@ -313,7 +313,7 @@ LRESULT CALLBACK menuProc(HWND handle, UINT message, WPARAM wParam, LPARAM lPara return CallWindowProc(reinterpret_cast(mainProc), handle, message, wParam, lParam); } -#include "../fileio/fileio.hpp" +#include "fileio.hpp" #include "boe.graphics.hpp" #include "boe.actions.hpp" #include "boe.fileio.hpp" From 94e829205c9b829fa730837897c4f2ab3f031c23 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jun 2024 22:26:02 -0600 Subject: [PATCH 43/46] Pass 86, not 32, where it's required --- SConstruct | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index 050040b06..c63ad0036 100644 --- a/SConstruct +++ b/SConstruct @@ -35,6 +35,7 @@ Help(opts.GenerateHelpText(env)) platform = env['OS'] toolset = env['toolset'] arch = 'x86_64' if (env['bits'] == '64') else 'x86' +arch_short = '64' if (env['bits'] == '64') else '86' # Some kinda gnarly logic required to figure out which targets to build possible_targets = ['game', 'pcedit', 'scenedit', 'test'] @@ -186,8 +187,8 @@ if platform == "darwin": elif platform == "win32": if 'msvc' in env['TOOLS']: vcpkg_prefix = path.join((os.environ['HOME'] if 'HOME' in os.environ else 'C:\\'), 'vcpkg') - vcpkg_installed = path.join(vcpkg_prefix, 'installed', f'x{env["bits"]}-windows') - vcpkg_other_packages = Glob(path.join(vcpkg_prefix, 'packages', f'**x{env["bits"]}-windows')) + vcpkg_installed = path.join(vcpkg_prefix, 'installed', f'x{arch_short}-windows') + vcpkg_other_packages = Glob(path.join(vcpkg_prefix, 'packages', f'**x{arch_short}-windows')) vcpkg_other_includes = [path.join(d.get_abspath(), 'include') for d in vcpkg_other_packages] vcpkg_other_includes = list(filter(path.exists, vcpkg_other_includes)) vcpkg_other_libs = [path.join(d.get_abspath(), 'lib') for d in vcpkg_other_packages] @@ -200,7 +201,7 @@ elif platform == "win32": include_paths=[path.join(vcpkg_installed, 'include')] + vcpkg_other_includes + project_includes env.Append( - LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], + LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{arch_short}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], CPPPATH=include_paths, LIBPATH=[path.join(vcpkg_installed, 'lib')] + vcpkg_other_libs + vcpkg_other_bins, From 0db155707349a0138c14629700b2b23cdd919fb0 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Tue, 11 Jun 2024 09:10:48 -0600 Subject: [PATCH 44/46] test scons pass X86 correctly --- test/SConscript | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/SConscript b/test/SConscript index d75947438..202d7b2db 100644 --- a/test/SConscript +++ b/test/SConscript @@ -2,6 +2,7 @@ import subprocess Import("env platform party_classes common_sources") +arch_short = '64' if (env['bits'] == '64') else '86' # Add path to scons env.Append(CPPPATH=['./deps/Catch2/single_include']) @@ -11,7 +12,7 @@ test_sources = Glob("""*.cpp""") + Split(""" """) 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{env["bits"]}') + test = env.Program("#build/bin/boe_test", party_classes + common_sources + test_sources, LINKFLAGS=f'/nologo /SUBSYSTEM:CONSOLE /MACHINE:X{arch_short}') else: test = env.Program("#build/bin/boe_test", test_sources + party_classes + common_sources) From 5633bdef350c258e350ec29a5a20e36dac6b31f3 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Tue, 11 Jun 2024 18:44:34 -0600 Subject: [PATCH 45/46] make 64-bit builds the default for scons --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index c63ad0036..552ac9cfe 100644 --- a/SConstruct +++ b/SConstruct @@ -9,7 +9,7 @@ opts = Variables(None, ARGUMENTS) opts.Add(EnumVariable('OS', "Target platform", str(Platform()), ('darwin', 'win32', 'posix'))) opts.Add('toolset', "Toolset to pass to the SCons builder", 'default') opts.Add(BoolVariable('debug', "Build with debug symbols and no optimization", False)) -opts.Add(EnumVariable('bits', "Build for 32-bit or 64-bit architectures", '32', ('32', '64'))) +opts.Add(EnumVariable('bits', "Build for 32-bit or 64-bit architectures", '64', ('32', '64'))) # Partial build flags -- by default, all targets will be built, # but if at least one is specified, ONLY the specified targets will be built From 876994780f15900ed1241ef56371bc6c95fd888c Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Tue, 11 Jun 2024 18:52:10 -0600 Subject: [PATCH 46/46] add package flag for building installers --- SConstruct | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/SConstruct b/SConstruct index 552ac9cfe..ad1f5b85d 100644 --- a/SConstruct +++ b/SConstruct @@ -19,6 +19,10 @@ opts.Add(EnumVariable('pcedit', 'Build the character editor', 'default', partial opts.Add(EnumVariable('scenedit', 'Build the scenario editor', 'default', partial_options)) opts.Add(EnumVariable('test', 'Build the tests', 'default', partial_options)) +# Package build flag -- when explicitly specified, Mac and Windows builds will also +# try to build an installer. +opts.Add(BoolVariable('package', "Build an installer", False)) + # Compiler configuration opts.Add("CXX", "C++ compiler") opts.Add("CC", "C compiler") @@ -484,12 +488,17 @@ elif platform == "win32": os.makedirs("build/Blades of Exile", exist_ok=True) open("build/Blades of Exile/VCRedistInstall.exe", 'w').close() -if platform == "darwin": - env.VariantDir("#build/pkg", "pkg/mac") - SConscript("build/pkg/SConscript") -#elif platform == "win32" and subprocess.call(['where', '/Q', 'makensis']) == 0: -# env.VariantDir("#build/pkg", "pkg/win") -# SConscript("build/pkg/SConscript") +if env["package"]: + if platform == "darwin": + env.VariantDir("#build/pkg", "pkg/mac") + SConscript("build/pkg/SConscript") + elif platform == "win32": + if subprocess.call(['where', '/Q', 'makensis']) == 0: + env.VariantDir("#build/pkg", "pkg/win") + SConscript("build/pkg/SConscript") + else: + print('NSIS must be installed to generate an installer for Windows.') + Exit(1) # Cleanup