Skip to content

Commit

Permalink
update windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
admercs committed Feb 20, 2024
1 parent 905a392 commit 5013f50
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
run: |
# Set-PSDebug -Trace 1
$CMAKE_GENERATOR_PLATFORM = "Visual Studio 17 2022"
./scripts/build.ps1 -BuildMode "Release" -Deploy
./scripts/build.ps1 -BuildMode "Release" -IntegrateDeploy
48 changes: 24 additions & 24 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ param(
$SystemDebug = $false,
[Parameter(HelpMessage = 'Enable for CI/CD mode (e.g., GitHub Actions).')]
[Switch]
$Deploy = $false
$IntegrateDeploy = $false
)

###
Expand Down Expand Up @@ -74,9 +74,9 @@ $SCRIPT_DIR = "$PROJECT_DIR\scripts"
# Command-line arguments
$BUILD_MODE = "$BuildMode"
$BUILD_DOCS = if ($BuildDocs) { $true } else { $false }
$HIGH_POLYCOUNT_SUV = if ($HighPolycountSuv) { $true } else { $false }
$DEBUG_MODE = if ($SystemDebug) { $true } else { $false }
$CI_CD_MODE = if ($Deploy -eq $true) { $true } else { $false }
$ASSET_SUV_GET = if ($HighPolycountSuv) { $true } else { $false }
$CI_CD_MODE = if ($IntegrateDeploy -eq $true) { $true } else { $false }

# Dynamic variables
$SYSTEM_INFO = Get-ComputerInfo # Windows only
Expand Down Expand Up @@ -174,45 +174,45 @@ Write-Output ''
Write-Output '-----------------------------------------------------------------------------------------'
Write-Output ' Parameters'
Write-Output '-----------------------------------------------------------------------------------------'
Write-Output " Project directory: $PROJECT_DIR"
Write-Output " Script directory: $SCRIPT_DIR"
Write-Output " Project directory: $PROJECT_DIR"
Write-Output " Script directory: $SCRIPT_DIR"
Write-Output '-----------------------------------------------------------------------------------------'
Write-Output " Processor: $SYSTEM_PROCESSOR"
Write-Output " Architecture: $SYSTEM_ARCHITECTURE"
Write-Output " Platform: $SYSTEM_PLATFORM"
Write-Output " CPU count max: $SYSTEM_CPU_MAX"
Write-Output " Build mode: $BUILD_MODE"
Write-Output " Processor: $SYSTEM_PROCESSOR"
Write-Output " Architecture: $SYSTEM_ARCHITECTURE"
Write-Output " Platform: $SYSTEM_PLATFORM"
Write-Output " CPU count max: $SYSTEM_CPU_MAX"
Write-Output " Build mode: $BUILD_MODE"
Write-Output '-----------------------------------------------------------------------------------------'
Write-Output " Debug mode: $DEBUG_MODE"
Write-Output " CI/CD mode: $CI_CD_MODE"
Write-Output " Debug mode: $DEBUG_MODE"
Write-Output " CI/CD mode: $CI_CD_MODE"
Write-Output '-----------------------------------------------------------------------------------------'
Write-Output " Windows version: $SYSTEM_OS_VERSION"
Write-Output " Visual Studio version: $VS_VERSION"
Write-Output " CMake version: $CMAKE_VERSION"
Write-Output " RPClib version: $RPCLIB_VERSION"
Write-Output " Eigen version: $EIGEN_VERSION"
Write-Output " SUV asset version: $ASSET_SUV_VERSION"
Write-Output " High-polycount SUV: $HIGH_POLYCOUNT_SUV"
Write-Output " Windows version: $SYSTEM_OS_VERSION"
Write-Output " Visual Studio version: $VS_VERSION"
Write-Output " CMake version: $CMAKE_VERSION"
Write-Output " RPClib version: $RPCLIB_VERSION"
Write-Output " Eigen version: $EIGEN_VERSION"
Write-Output " High-polycount SUV version: $ASSET_SUV_VERSION"
Write-Output " High-polycount SUV: $ASSET_SUV_GET"
Write-Output '-----------------------------------------------------------------------------------------'
Write-Output ''

# Ensure script is run from `AutonomySim` project directory
Test-WorkingDirectory

# Test Visual Studio version
# Test Visual Studio version (optionally automated for CI/CD)
Test-VisualStudioVersion -Automate $CI_CD_MODE

# Test CMake version
# Test CMake version (downloads and installs CMake)
Test-CmakeVersion

# Create temporary build directories if they do not exist
# Create temporary directories if they do not exist
Add-Directories -Directories @('temp', 'external', 'external\rpclib')

# Test RPClib version
# Test RpcLib version (downloads and builds rpclib)
Test-RpcLibVersion

# Test high-polycount SUV asset
Test-AssetSuvVersion -HighPolycountSuv $HIGH_POLYCOUNT_SUV
Test-AssetSuvVersion -HighPolycountSuv $ASSET_SUV_GET

# Test Eigen library version
Test-EigenVersion
Expand Down
8 changes: 4 additions & 4 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ else
make \
cmake
else
# if CMake binary not found, build it from source
# If CMake binary not found, build it from source
if [ ! -d "cmake_build/bin" ]; then
echo "Downloading cmake..."
echo "Downloading CMake..."
wget https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz -O cmake.tar.gz
tar -xzf cmake.tar.gz
rm cmake.tar.gz
Expand All @@ -156,14 +156,14 @@ else
fi
fi

# Download and unpack rpclib.
# Download and unpack RPCLib.
if [ ! -d "external/rpclib/rpclib-2.3.0" ]; then
# remove previous versions and create empty directory
rm -rf "external/rpclib"
mkdir -p "external/rpclib"
echo ''
echo '-----------------------------------------------------------------------------------------'
echo ' Downloading rpclib...'
echo ' Downloading RPCLib...'
echo '-----------------------------------------------------------------------------------------'
wget https://github.com/rpclib/rpclib/archive/v2.3.0.zip
unzip -q v2.3.0.zip -d external/rpclib
Expand Down
20 changes: 10 additions & 10 deletions scripts/test_rpclib.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Import-Module "${PWD}\scripts\utils.psm1" # imports: Add-Directori
function Get-RpcLib {
Write-Output ''
Write-Output '-----------------------------------------------------------------------------------------'
Write-Output " Downloading rpclib version $RPCLIB_VERSION"
Write-Output " Downloading rpclib version ${RPCLIB_VERSION}..."
Write-Output '-----------------------------------------------------------------------------------------'
Write-Output ''

Expand All @@ -65,21 +65,21 @@ function Get-RpcLib {
function Build-RpcLib {
Write-Output ''
Write-Output '-----------------------------------------------------------------------------------------'
Write-Output " Building rpclib version $RPCLIB_VERSION with Cmake version $CMAKE_VERSION"
Write-Output " Building rpclib version ${RPCLIB_VERSION} with CMake version ${CMAKE_VERSION}..."
Write-Output '-----------------------------------------------------------------------------------------'
Write-Output ''

[System.IO.Directory]::CreateDirectory("${RPCLIB_PATH}\build")
Set-Location "${RPCLIB_PATH}\build"
Write-Output "Current directory: ${RPCLIB_PATH}\build"

Start-Process -FilePath 'cmake.exe' -ArgumentList "-G $VS_GENERATOR", '..' -Wait -NoNewWindow
Start-Process -FilePath 'cmake.exe' -ArgumentList "-G ${VS_GENERATOR}", '..' -Wait -NoNewWindow
if ( $BUILD_MODE -eq 'Release' ) {
Start-Process -FilePath 'cmake.exe' -ArgumentList '--build', '.' -Wait -NoNewWindow
Start-Process -FilePath 'cmake.exe' -ArgumentList '--build', '.', '--config Release' -Wait -NoNewWindow
}
else {
Start-Process -FilePath 'cmake.exe' -ArgumentList '--build', '.', "--config $BUILD_MODE" -Wait -NoNewWindow
Start-Process -FilePath 'cmake.exe' -ArgumentList '--build', '.', "--config ${BUILD_MODE}" -Wait -NoNewWindow
}
if (!$?) { exit $LASTEXITCODE } # exit on error

Expand All @@ -93,13 +93,13 @@ function Build-RpcLib {
[System.IO.Directory]::CreateDirectory($RPCLIB_TARGET_INCLUDE)

# copy directories robustly
Copy-Item -Path "$RPCLIB_PATH\include" -Destination "$RPCLIB_TARGET_INCLUDE"
Copy-Item -Path "${RPCLIB_PATH}\include" -Destination "${RPCLIB_TARGET_INCLUDE}"
if ( $BUILD_MODE -eq 'Release' ) {
Copy-Item -Path "$RPCLIB_PATH\build\Debug" -Destination "$RPCLIB_TARGET_LIB\Debug"
Copy-Item -Path "$RPCLIB_PATH\build\Release" -Destination "$RPCLIB_TARGET_LIB\Release"
Copy-Item -Path "${RPCLIB_PATH}\build\Debug" -Destination "${RPCLIB_TARGET_LIB}\Debug"
Copy-Item -Path "${RPCLIB_PATH}\build\Release" -Destination "${RPCLIB_TARGET_LIB}\Release"
}
else {
Copy-Item -Path "$RPCLIB_PATH\build\$BUILD_MODE" -Destination "$RPCLIB_TARGET_LIB\$BUILD_MODE"
Copy-Item -Path "${RPCLIB_PATH}\build\${BUILD_MODE}" -Destination "${RPCLIB_TARGET_LIB}\$BUILD_MODE"
}
}

Expand All @@ -113,11 +113,11 @@ function Test-RpcLibVersion {
# Fail if rpclib version path not found
if ( -not (Test-Path -LiteralPath "$RPCLIB_PATH") ) {
Write-Error 'Error: Download and build of rpclib failed. Stopping build.' -ErrorAction SilentlyContinue
Invoke-Fail -ErrorMessage "Error: Failed to download and build RCPLib."
Invoke-Fail -ErrorMessage "Error: Failed to download and build rpclib."
}
}
else {
Write-Output "Existing installation of rpclib version $RPCLIB_VERSION found."
Write-Output "Existing installation of rpclib version ${RPCLIB_VERSION} found."
}
}

Expand Down

0 comments on commit 5013f50

Please sign in to comment.