In PowerShell as Administrator:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
This will allow you to execute PowerShell scripts locally on your machine.
Update $env:PSModulePath
so that you can use PowerShell modules.
In PowerShell as Administrator:
[Environment]::SetEnvironmentVariable("PSModulePath", "$HOME/Documents/WindowsPowerShell/Modules;" + $env:PSModulePath, "Machine")
This is needed for the C++ compiler. Install Visual Studio 2022 Community Edition.
During installation select C++ desktop development and latest Windows 10 SDK.
After installation open Visual Studio and check for updates. Install the latest 2022 version that is available.
Install the Visual Studio Setup PowerShell Module. In PowerShell as Administrator:
Install-Module VSSetup -Scope CurrentUser
Close and reopen PowerShell
Test:
Get-VSSetupInstance `
| Select-VSSetupInstance -Version '[17.0,18.0]' `
| Select-Object -ExpandProperty InstallationPath
This finds the installation path for Visual Studio 2022.
git clone https://github.com/microsoft/vcpkg "$HOME/vcpkg"
cd $HOME/vcpkg; ./bootstrap-vcpkg.bat
Install via winget. In PowerShell:
winget install Kitware.CMake --silent --override "ADD_CMAKE_TO_PATH=System"
Install via winget. In PowerShell:
winget install Ninja-build.Ninja --silent
Build it from source:
cd $HOME
git clone https://github.com/ninja-build/ninja
cd ninja
git checkout tags/v1.11.1 -b v1.11.1
cmake -Bbuild -A arm64
cmake --build build --parallel --config Release
mkdir C:/tools/ninja
cp ./build/Release/ninja.exe C:/tools/ninja/
Add to PATH. In PowerShell as Administrator:
[System.Environment]::SetEnvironmentVariable("Path", "C:\tools\ninja;" + $env:Path, "Machine")
Close and reopen PowerShell to refresh PATH.
Test:
ninja --version