Skip to content

Commit ffab7c3

Browse files
author
Tom Seddon
committed
Merge branch 'master' into wip/tom
2 parents 897b3b6 + 3fb6677 commit ffab7c3

File tree

4 files changed

+41
-8
lines changed

4 files changed

+41
-8
lines changed

Makefile.windows.mak

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ SHELL:=$(windir)\system32\cmd.exe
44
##########################################################################
55
##########################################################################
66

7+
.PHONY:init_vs2022
8+
init_vs2022:
9+
$(MAKE) _newer_vs VSYEAR=2022 VSVER=17 VSVERNAME="Visual Studio 17 2022"
10+
711
.PHONY:init_vs2019
812
init_vs2019:
9-
$(MAKE) _newer_vs VSYEAR=2019 VSVER=16
13+
$(MAKE) _newer_vs VSYEAR=2019 VSVER=16 VSVERNAME="Visual Studio 16"
1014

1115
##########################################################################
1216
##########################################################################
@@ -18,12 +22,17 @@ _newer_vs: FOLDER=$(BUILD_FOLDER)/$(FOLDER_PREFIX)vs$(VSYEAR)
1822
_newer_vs:
1923
$(if $(VS_PATH),,$(error Visual Studio $(VSYEAR) installation not found))
2024
cmd /c bin\recreate_folder.bat $(FOLDER)
21-
cd "$(FOLDER)" && "$(CMAKE)" $(CMAKE_DEFINES) -G "$(strip Visual Studio $(VSVER))" -A x64 ../..
25+
cd "$(FOLDER)" && "..\..\bin\msbuild_bug_wrapper.bat" "$(CMAKE)" $(CMAKE_DEFINES) -G "$(VSVERNAME)" -A x64 ../..
2226
$(SHELLCMD) copy-file etc\b2.ChildProcessDbgSettings "$(FOLDER)"
2327

2428
##########################################################################
2529
##########################################################################
2630

31+
.PHONY: run_tests_vs2022
32+
run_tests_vs2022: CONFIG=$(error Must specify CONFIG)
33+
run_tests_vs2022:
34+
$(MAKE) _run_tests VSYEAR=2022 VSVER=17 CONFIG=$(CONFIG)
35+
2736
.PHONY: run_tests_vs2019
2837
run_tests_vs2019: CONFIG=$(error Must specify CONFIG)
2938
run_tests_vs2019:

bin/msbuild_bug_wrapper.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@echo off
2+
3+
setlocal
4+
5+
REM workaround for https://github.com/dotnet/msbuild/issues/5726
6+
REM
7+
REM This is not really a proper solution. It looks like any variable could
8+
REM cause, so, really, the entire environment needs fixing up. But it seems
9+
REM GNU Make renames Path to PATH specifically, leaving everything else
10+
REM the same, so, fingers crossed, this'll cover it for b2 building
11+
REM purposes.
12+
13+
set _MSBUILD_BUG_WRAPPER_TEMP=%PATH%
14+
set PATH=
15+
set Path=%_MSBUILD_BUG_WRAPPER_TEMP%
16+
set _MSBUILD_BUG_WRAPPER_TEMP=
17+
%*

doc/Building-on-Windows.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
Prerequisites:
44

5-
- Visual Studio 2019 (ensure C++ CMake tools for Windows is included)
5+
- Visual Studio 2022 or Visual Studio 2019 (ensure C++ CMake tools
6+
for Windows is included)
67
- Python 3.x (the version that comes with Visual Studio 2019 is fine)
78

89
Optional, but recommended:
@@ -13,16 +14,20 @@ Initial setup, for use after cloning or updating the repo:
1314

1415
1. Open command prompt in working copy folder
1516

16-
2. Run `make init_vs2019` to generate a solution for Visual Studio
17-
2019.
17+
2. Run `make init_vs2022` to generate a solution for Visual Studio
18+
2022, or `make init_vs2019` to generate a solution for Visual
19+
Studio 2019
1820

1921
You should get a bunch of output - there may be the odd warning,
2022
but there should be no obvious errors, and it should finish with an
2123
exit code of 0
2224

2325
General day-to-day build steps:
2426

25-
1. Load solution into Visual Studio: `build\vs2019\b2.sln`
27+
1. Load solution into Visual Studio:
28+
29+
- `build\vs2019\b2.sln` if using VS2019
30+
- `build\vs2022\b2.sln` if using VS2022
2631

2732
2. Build
2833

@@ -37,6 +42,8 @@ information and the initial build steps ensure everything is rebuilt.)
3742
- Because of the way cmake works, there are 50+ projects in the
3843
solution. Even though most are rarely used, they're still there
3944
cluttering the place up. You just have to put up with this
45+
46+
- support for Visual Studio 2019 will probably go away eventually...
4047

4148
# Running the automated tests
4249

etc/release/release.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def get_win32_vs_path(options):
167167
fatal('Visual Studio not installed? vswhere.exe not found at: %s'%vswhere_path)
168168

169169
if options.toolchain=='vs2019': ver=16
170+
elif options.toolchain=='vs2022': ver=17
170171
else: fatal('unknown toolchain: %s'%options.toolchain)
171172

172173
installation_path=subprocess.check_output([vswhere_path,'-version',str(ver),'-property','installationPath']).decode('utf-8').rstrip()
@@ -528,8 +529,7 @@ def timestamp(x): return datetime.datetime.strptime(x,"%Y%m%d-%H%M%S")
528529
parser.add_argument('--gh-release',action='store_true',help='''create GitHub release (or prerelease if not on master git branch) and upload artefacts''')
529530

530531
if sys.platform=='win32':
531-
# TODO: sort this out...
532-
parser.set_defaults(toolchain='vs2019')
532+
parser.add_argument('-t','--toolchain',default='vs2022',help='''Specify toolchain: vs2019, or vs2022. Default: %(default)s''')
533533

534534
if sys.platform=='darwin':
535535
macos_deployment_target_help='''macOS deployment target. Default is whatever the Makefile defaults to'''

0 commit comments

Comments
 (0)