Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a build script for windows and documentation for it #115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions build/build_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
if ($args -contains "-it") {
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
winget install --id Git.Git -e
}
if (-not (Get-Command python -ErrorAction SilentlyContinue)) {
winget install --id Python.Python -e
}
if (-not (Get-Command cl -ErrorAction SilentlyContinue)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will trigger the winget installation when a VS CLI session is not active, which is probably not what you want (given that scons is able to figure out where it's at without a VS command prompt window not needing to be active).

winget install --id Microsoft.VisualStudio.2022.BuildTools -e
}
}
if ($args -contains "-ci") {
Set-Location ..
} else {
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
winget install --id Git.Git -e
}
git clone https://github.com/samtupy/nvgt
Set-Location -Path "nvgt"
}
$windevPath = "windev"
if (-not (Test-Path $windevPath) -or (Get-ChildItem $windevPath -Recurse | Measure-Object).Count -eq 0) {
$windevZipUrl = "https://nvgt.gg/windev.zip"
$zipFile = "$env:TEMP\windev.zip"
Invoke-WebRequest -Uri $windevZipUrl -OutFile $zipFile
New-Item -ItemType Directory -Path $windevPath -Force
Expand-Archive -Path $zipFile -DestinationPath $windevPath -Force
}
python -m pip install scons
scons -s
31 changes: 31 additions & 0 deletions doc/src/advanced/Building NVGT For windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# building nvgt on windows
## building with the build_windows.ps1 script
there is a {script for building nvgt for windows}(https://github.com/samtupy/nvgt/blob/main/build/build_windows.sh)
this script can take multiple parameters for controlling the behaviour of the script
* -it: this parameter instructs the script to download the relevant tooling that will be used, this includes a compiler, python, and git
*ci: this parameter tells the script that you have already cloned the repo and it will proseed to download dependencies and build nvgt
### notes
powershell might refuse to execute the script do to execution policys, in that case run the command:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
this will apply this change for the current session of powershell only
for a more permanent solution run one of the following:
* Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser: this will set this property for the current user only
* Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine: this will do it for the intire system
setting this setting permanently requires running powershell as admin
## building nvgt manualy
if you do not want to use the script for building nvgt you can do it manualy,
### required software
* a c++ compiler: the one coming with microsoft visual studio22 comunity eddition is recommended
* git: for cloning the repository
* python: for installing and using scons
### instructions
* 1. open a command prompt and navigate to a directory where you want to download nvgt
* 2. run the following command: git clone https://github.com/samtupy/nvgt
* 3. type cd nvgt
* 4. open a webb browser and (download windev.zip){https://nvgt.gg/windev.zip}
*5. extract windev.zip to the github repo you cloned earlyer/windev. so if i cloned the repo to c:\cloned_repos\nvgt the windev.zip should be extracted to c:\cloned_repos\nvgt\windev
6. go back to your command prompt and run the following commands:
python -m pip install scons
scons -s
#### notes
the scons -s command and pip and or python commands might not work correctly. in that case, google on how to add python packages to environment variable or something along those lines