Clear velocity and avelocity in MoveDone #488
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
workflow_call: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: RelWithDebInfo | |
jobs: | |
build-platform-linux: | |
strategy: | |
matrix: | |
architecture: [ | |
{name: 'amd64', triple: 'x86_64-linux-gnu'}, | |
{name: 'i686', triple: 'i686-linux-gnu'}, | |
{name: 'arm64', triple: 'aarch64-linux-gnu'}, | |
{name: 'armhf', triple: 'arm-linux-gnueabihf'}, | |
{name: 'powerpc', triple: 'powerpc-linux-gnu'}, | |
{name: 'ppc64', triple: 'powerpc64-linux-gnu'}, | |
{name: 'ppc64el', triple: 'powerpc64le-linux-gnu'} | |
] | |
name: "Building for platform linux-${{matrix.architecture.name}}" | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Settings | |
working-directory: ${{github.workspace}} | |
run: | | |
echo "CMAKE_BUILD_PARALLEL_LEVEL=$(($(nproc) * 16))" >> $GITHUB_ENV | |
# echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV | |
- name: Install required packages | |
run: | | |
sudo apt update && sudo apt install -y flex bison \ | |
libpulse-dev portaudio19-dev libasound2-dev libjack-dev libpipewire-0.3-dev qtbase5-dev libdbus-1-dev | |
- name: Install required cross-platform packages (${{ matrix.architecture.triple }}) | |
if: matrix.architecture.name != 'amd64' | |
run: sudo apt install -y gcc-12-${{ matrix.architecture.triple }} g++-12-${{ matrix.architecture.triple }} | |
# Setup SDL | |
- name: Set up SDL | |
id: sdl | |
uses: libsdl-org/setup-sdl@main | |
with: | |
version: sdl2-latest | |
build-type: Release | |
cmake-arguments: "-DCMAKE_C_COMPILER=clang | |
-DCMAKE_CXX_COMPILER=clang++ | |
-DCMAKE_C_FLAGS=--target=${{ matrix.architecture.triple }} | |
-DCMAKE_CXX_FLAGS=--target=${{ matrix.architecture.triple }}" | |
# soft-oal setup | |
# Use GCC instead of Clang because of missing SSE intrinsics | |
# It also doesn't enable altivec support on PowerPC by default | |
- name: Checkout soft-oal | |
uses: actions/checkout@v4 | |
with: | |
repository: 'kcat/openal-soft' | |
path: 'thirdparties/soft-oal' | |
ref: '1.23.1' | |
- name: Configure and install soft-oal | |
working-directory: ${{github.workspace}}/thirdparties/soft-oal | |
run: | | |
cmake -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ | |
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' \ | |
-DCMAKE_C_COMPILER=${{ matrix.architecture.triple }}-gcc-12 \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.architecture.triple }}-g++-12 | |
cmake --build ./build --config ${{env.BUILD_TYPE}} | |
cmake --install ./build --config ${{env.BUILD_TYPE}} | |
- uses: actions/checkout@v4 | |
with: | |
path: 'source' | |
- name: CMake Settings | |
run: | | |
echo "CMAKE_PARAM=--log-level=VERBOSE \ | |
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ | |
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \ | |
-DCMAKE_C_COMPILER=clang \ | |
-DCMAKE_CXX_COMPILER=clang++ \ | |
-DCMAKE_C_FLAGS=--target=${{ matrix.architecture.triple }} \ | |
-DCMAKE_CXX_FLAGS=--target=${{ matrix.architecture.triple }} \ | |
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' \ | |
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/include' \ | |
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV | |
- name: Configure CMake | |
working-directory: ${{github.workspace}} | |
run: | | |
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source | |
- name: Build | |
working-directory: ${{github.workspace}} | |
run: | | |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Test | |
working-directory: ${{github.workspace}} | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: | | |
cd "${{github.workspace}}/build" | |
ctest -C ${{env.BUILD_TYPE}} | |
- name: Install | |
working-directory: ${{github.workspace}} | |
# Install to the directory defined in CMAKE_INSTALL_PREFIX | |
run: | | |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
# Create hard-link and copy symbolic links | |
cp -l ${{steps.sdl.outputs.prefix}}/lib/libSDL2-2.0.so.0 '${{github.workspace}}/install/' | |
cp -l ${{github.workspace}}/thirdparties/soft-oal/install/lib/libopenal.so.1 '${{github.workspace}}/install/' | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: out-linux-${{matrix.architecture.name}} | |
if-no-files-found: error | |
path: | |
${{github.workspace}}/install | |
build-platform-windows: | |
strategy: | |
matrix: | |
architecture: [ | |
{name: 'x64', config: 'x64' }, | |
{name: 'x86', config: 'Win32' }, | |
{name: 'arm64', config: 'ARM64' } | |
] | |
name: "Building for platform windows-${{matrix.architecture.name}}" | |
runs-on: windows-2022 | |
steps: | |
- name: Settings | |
working-directory: ${{github.workspace}} | |
run: | | |
echo "CMAKE_BUILD_PARALLEL_LEVEL=$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors * 16)" >> $GITHUB_ENV | |
# Setup SDL | |
- name: Set up SDL | |
id: sdl | |
uses: libsdl-org/setup-sdl@main | |
with: | |
version: sdl2-latest | |
build-type: Release | |
cmake-arguments: "-A ${{ matrix.architecture.config }}" | |
- name: Install Flex/Bison | |
working-directory: ${{github.workspace}} | |
run: | | |
mkdir thirdparties && cd thirdparties | |
git clone --depth 1 --single-branch --branch v2.5.25 https://github.com/lexxmark/winflexbison.git | |
cmake -B winflexbison-build -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/winflexbison-install' ./winflexbison | |
cmake --build winflexbison-build --config Release --parallel | |
cmake --install winflexbison-build | |
# soft-oal setup | |
- name: Checkout soft-oal | |
uses: actions/checkout@v4 | |
with: | |
repository: 'kcat/openal-soft' | |
path: 'thirdparties/soft-oal' | |
ref: '1.23.1' | |
# soft-oal build | |
# Statically link the CRT runtime into OAL as a workaround to prevent crashes | |
- name: Configure and install soft-oal | |
working-directory: ${{github.workspace}}/thirdparties/soft-oal | |
run: | | |
cmake -B ./build -A ${{ matrix.architecture.config }} ` | |
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ` | |
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' ` | |
-DALSOFT_BUILD_ROUTER=OFF ` | |
-DALSOFT_REQUIRE_WINMM=ON ` | |
-DALSOFT_REQUIRE_DSOUND=ON ` | |
-DALSOFT_REQUIRE_WASAPI=ON ` | |
-DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" ` | |
-DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" ` | |
-DCMAKE_C_FLAGS_MINSIZEREL="/MT /O2 /Ob2 /DNDEBUG" ` | |
-DCMAKE_CXX_FLAGS_MINSIZEREL="/MT /O1 /Ob1 /DNDEBUG" ` | |
-DCMAKE_C_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG" ` | |
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG" | |
cmake --build ./build --config ${{env.BUILD_TYPE}} | |
cmake --install ./build --config ${{env.BUILD_TYPE}} | |
# Unfortunately soft-oal produces a binary called OpenAL32 even in 64-bit | |
if ("${{ matrix.architecture.config }}" -eq "x64") { Rename-Item -Path '.\install\bin\OpenAL32.dll' -NewName 'OpenAL64.dll' } | |
- uses: actions/checkout@v4 | |
with: | |
path: 'source' | |
- name: CMake Settings | |
run: | | |
echo "CMAKE_PARAM=-A ${{ matrix.architecture.config }} ` | |
--log-level=VERBOSE ` | |
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ` | |
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' ` | |
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} ` | |
-DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' ` | |
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' ` | |
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/include' ` | |
-DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe'".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV | |
- name: Configure CMake | |
working-directory: ${{github.workspace}} | |
run: | | |
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source | |
- name: Build | |
working-directory: ${{github.workspace}} | |
run: | | |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Test | |
working-directory: ${{github.workspace}} | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: | | |
cd "${{github.workspace}}/build" | |
ctest -C ${{env.BUILD_TYPE}} | |
- name: Install | |
working-directory: ${{github.workspace}} | |
# Install to the directory defined in CMAKE_INSTALL_PREFIX | |
run: | | |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
Copy-Item '${{steps.sdl.outputs.prefix}}/bin/*.dll' -Destination '${{github.workspace}}/install' | |
Copy-Item '${{github.workspace}}/thirdparties/soft-oal/install/bin/*.dll' -Destination '${{github.workspace}}/install' | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: out-windows-${{matrix.architecture.name}} | |
if-no-files-found: error | |
path: | | |
${{github.workspace}}/install | |
!${{github.workspace}}/install/**/*.pdb | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: out-windows-${{matrix.architecture.name}}-pdb | |
if-no-files-found: error | |
path: | | |
${{github.workspace}}/install |