This is a monorepo with my game mods.
- Build Tools for Visual Studio 2022 (or later):
winget install Microsoft.VisualStudio.2022.BuildTools
- MSBuild Tools
- Desktop development with C++
- MSVC (latest)
- .Net SDK
- .Net 6.0 Runtime
- CMake >= 3.24: This is probably included with VS Desktop Dev w/ C++, but you can also get it from winget:
winget install Kitware.CMake
- Ninja: You can pip install it, but I couldn't build without using the VS dev shell, so might as well use the one that comes with VS Desktop Dev w/ C++...
- PowerShell:
winget install --id Microsoft.Powershell
There's a make.ps1 script that you should find useful. (It's not a Makefile because winget has an old AF version of GNU Make).
I have this alias in my profile:
Set-Alias make ./make.ps1
This lets me use this script like it's make
. But you can just run the script like ./make.ps1
See
make help
for commands that are available.
You can probably open this in VS and it'll maybe do the right thing? But use the cli.
Before you can build, you have to enter a VS dev shell to get build tools in you path and whatever strange variables set. VS has some helper scripts not in your path to get you there. You should probably google how other people do it. I just have this in my profile:
function dev() {
$MSVS = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
Import-Module $MSVS\Common7\Tools\Microsoft.VisualStudio.DevShell.dll
Enter-VsDevShell -SkipAutomaticLocation -SetDefaultWindowTitle -DevCmdArguments '-arch=x64' -InstallPath $MSVS
}
Typing dev
gets me there. Now you can:
make deps
: Restores NuGet packages and generates the Ninja build project. Do this one time.make build
: Build all the projects.make clean
: Clean up build output... You'll have tomake deps
again, though. Don't do this if you want incremental builds
I added a make env
that lists the following environment variables with their current value or the default.
You probably don't want to set these. They are really just for the CI.
The best DX is provided by defaults. You're on your own if you set these:
- Set
$env:BuildConfiguration = "Release"
if you want to build release binaries.