chore(ci): Run workflow with clang on windows (#68)

* chore(ci): Run workflow with clang on windows

* fix compilation issue
This commit is contained in:
David Chavez 2024-08-05 13:49:58 +02:00 committed by GitHub
parent 825e5a8c78
commit cb631739b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -67,5 +67,8 @@ jobs:
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
$cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
# remove LLVM from PATH so it doesn't overshadow the one provided by VS
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';'
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
cmake --build cmake-build --config ${{ matrix.type }} --target rt64 -j $cpuCores

View File

@ -424,7 +424,7 @@ namespace RT64 {
scaledWidth = uint32_t(expandedColorWidthClamped);
scaledHeight = uint32_t(colorHeightClamped);
const long expandedPixels = std::labs(scaledWidth - nativeColorWidthClamped) / 2;
const long expandedPixels = std::labs(long(scaledWidth) - nativeColorWidthClamped) / 2;
const long nativeAlignment = std::max(lround(resolutionScale.y), 1L);
misalignmentX = (nativeAlignment - (expandedPixels % nativeAlignment)) % nativeAlignment;
}