From a57a234fda23abd979e8cc8d16440c0c17a55b3e Mon Sep 17 00:00:00 2001 From: csmartdalton Date: Thu, 15 Aug 2024 19:28:49 +0000 Subject: [PATCH] added some simple windows build scripts to make building on windows from powershell or command prompt easier added build_rive.bat and build_rive.ps1 to build from the command prompt and PowerShell respectively. also added some setup scripts to the scripts folder to auto-set the path to the correct location Diffs= fb7756072 added some simple windows build scripts to make building on windows from powershell or command prompt easier (#7800) Co-authored-by: Jonathon Copeland --- .rive_head | 2 +- build/build_rive.bat | 10 ++++++++++ build/build_rive.ps1 | 15 +++++++++++++++ build/build_rive.sh | 3 --- 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 build/build_rive.bat create mode 100644 build/build_rive.ps1 diff --git a/.rive_head b/.rive_head index ac7db820..b4f79f30 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -ed56d2de61afb05abd99e8bab6775b63ab89f1a3 +fb7756072f7c28fff774e536b6bbbca664a35664 diff --git a/build/build_rive.bat b/build/build_rive.bat new file mode 100644 index 00000000..a0d7a193 --- /dev/null +++ b/build/build_rive.bat @@ -0,0 +1,10 @@ +@echo off +REM we could check where vs is install via the registery like stated here https://superuser.com/questions/539666/how-to-get-the-visual-studio-installation-path-in-a-batch-file but i think that is overkill +if exist "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" CALL "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" +else ( + if exist CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" + else echo "Visual Studio 2022 does not appear to be installed, please install visual studio to C:\Program Files\Microsoft Visual Studio" +) + +cd %CD% +sh build_rive.sh %* diff --git a/build/build_rive.ps1 b/build/build_rive.ps1 new file mode 100644 index 00000000..b223f9c5 --- /dev/null +++ b/build/build_rive.ps1 @@ -0,0 +1,15 @@ +# requires Set-ExecutionPolicy Bypass -Scope CurrentUser +$CWD = Get-Location +if (Test-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1" -PathType Leaf) { + & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1" +} else { + if ("C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Launch-VsDevShell.ps1") { + & 'C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Launch-VsDevShell.ps1' + } + else { + Write-Error "Visual Studio 2022 does not appear to be installed, please install visual studio to C:\Program Files\Microsoft Visual Studio" + exit + } +} +Set-Location $CWD +sh build_rive.sh $args \ No newline at end of file diff --git a/build/build_rive.sh b/build/build_rive.sh index cb1a3054..30ad0879 100755 --- a/build/build_rive.sh +++ b/build/build_rive.sh @@ -80,9 +80,6 @@ case "$(uname -s)" in MINGW*|MSYS*) HOST_MACHINE="windows" NUM_CORES=$NUMBER_OF_PROCESSORS - # Try to find MSBuild.exe - export PATH="$PATH:$PROGRAMFILES/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin" - export PATH="$PATH:$PROGRAMFILES/Microsoft Visual Studio/2022/Community/Msbuild/Current/Bin" ;; Linux*) HOST_MACHINE="linux"