Skip to content

Commit

Permalink
update windows pwsh build
Browse files Browse the repository at this point in the history
  • Loading branch information
admercs committed Feb 29, 2024
1 parent e1db33b commit 224b27d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/test_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ jobs:
shell: pwsh
run: |
# Initialize Visual Studio 2022 Developer Command Prompt and prepend MSBuild to PATH.
[String]$VisualStudioDir = 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise'
. "${VisualStudioDir}\Common7\Tools\Launch-VsDevShell.ps1" -Latest
$ProjectDir = "$PWD"
$VisualStudioDir = 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise'
${env:PATH} += ";${VisualStudioDir}\MSBuild\Current\Bin"
${env:CMAKE_GENERATOR} = 'Visual Studio 17 2022'
. "${VisualStudioDir}\Common7\Tools\Launch-VsDevShell.ps1" -Latest
# Set-PSDebug -Trace 1
.\scripts\build.ps1 -BuildMode 'Release' -CmakeGenerator 'Visual Studio 17 2022' -UnrealAsset -Automate -Verbose
. "${ProjectDir}\scripts\build.ps1" -ProjectDir "$ProjectDir" -BuildMode 'Release' -CmakeGenerator "${env:CMAKE_GENERATOR}" -UnrealAsset -Automate -Verbose
21 changes: 13 additions & 8 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ AUTHOR:
DATE:
2024-02-27
PARAMETERS:
- ProjectDir: AutonomySim base directory.
- BuildMode: [ Debug | Release | RelWithDebInfo ]
- CmakeGenerator: [ Visual Studio 17 2022 | Visual Studio 16 2019 ]
- BuildDocs: Enable to build and serve AutonomySim documentation.
- SystemDebug: Enable for computer system debugging messages.
- UnrealEnvDir: Path to Unreal Environment directory.
- UnrealAsset: Enable for an Unreal Engine full-polycount SUV asset.
- SystemDebug: Enable for computer system debugging messages.
- Automate: Enable to automate Visual Studio installation selection.
NOTES:
- Assumes: PowerShell version >= 7, Unreal Engine >= 5, CMake >= 3.14, Visual Studio 2022.
Expand All @@ -29,24 +31,27 @@ WARNINGS:
###

param(
[Parameter(HelpMessage = 'AutonomySim base directory.')]
[String]
$ProjectDir = "$PWD",
[Parameter(HelpMessage = 'Options: [ Debug | Release | RelWithDebInfo ]')]
[String]
$BuildMode = 'Release',
[Parameter(HelpMessage = 'Options: [ Visual Studio 17 2022 | Visual Studio 16 2019 ]')]
[String]
$CmakeGenerator = 'Visual Studio 17 2022',
[Parameter(HelpMessage = 'Enable to build and serve AutonomySim documentation.')]
[Switch]
$BuildDocs,
[Parameter(HelpMessage = 'Path to Unreal Environment directory.')]
[String]
$UnrealEnvDir,
[Parameter(HelpMessage = 'Enable to build and serve AutonomySim documentation.')]
[Parameter(HelpMessage = 'Enable for an Unreal Engine full-polycount SUV asset.')]
[Switch]
$BuildDocs,
$UnrealAsset,
[Parameter(HelpMessage = 'Enable for computer system debugging messages.')]
[Switch]
$SystemDebug,
[Parameter(HelpMessage = 'Enable for an Unreal Engine full-polycount SUV asset.')]
[Switch]
$UnrealAsset,
[Parameter(HelpMessage = 'Enable for CI/CD mode (e.g., GitHub Actions).')]
[Switch]
$Automate
Expand Down Expand Up @@ -80,8 +85,8 @@ Import-Module "${PWD}\scripts\mod_docs.psm1" # imports: Build-Documenta
###

# Static variables
$PROJECT_DIR = "$PWD"
$SCRIPT_DIR = "${PROJECT_DIR}\scripts"
$PROJECT_DIR = "$ProjectDir"
$SCRIPT_DIR = "${ProjectDir}\scripts"
$UNREAL_ENV_DIR = if ( $PSBoundParameters.ContainsKey('UnrealEnvDir') ) {
"$UnrealEnvDir"
} else {
Expand Down

0 comments on commit 224b27d

Please sign in to comment.