From 463f377ffa8b04d899a2ad1cd439f84e554e8352 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Wed, 10 Apr 2024 13:26:44 -0700 Subject: [PATCH] Fix for build failure Don't use lukka/run-vcpkg or lukka/run-cmake, just use shell commands. Pin cmake at v3.27.6, newer versions break openxr --- .github/workflows/build.yaml | 42 +++++++++++++++---------------- .gitignore | 1 + CMakePresets.json | 49 ------------------------------------ tasks.py | 26 +++++++------------ vcpkg | 2 +- 5 files changed, 31 insertions(+), 89 deletions(-) delete mode 100644 CMakePresets.json diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index edfb665..b736f64 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,18 +12,17 @@ jobs: - name: Install System Packages uses: ConorMacBride/install-package@v1 with: - apt: libgl-dev libxcb-glx0-dev libglu1-mesa-dev libxxf86vm-dev libxrandr-dev + apt: libxmu-dev libxi-dev libgl-dev libxcb-glx0-dev libglu1-mesa-dev libxxf86vm-dev libxrandr-dev - name: Install CMake - uses: lukka/get-cmake@latest - - name: Install Vcpkg Packages - uses: lukka/run-vcpkg@v11 - with: - vcpkgJsonGlob: 'vcpkg.json' - - name: Configure and Build - uses: lukka/run-cmake@v10 - with: - configurePreset: 'make-vcpkg' - buildPreset: 'make-vcpkg-release' + uses: lukka/get-cmake@v3.27.6 + - name: Create Build Dir + run: mkdir build + - name: CMake Configure + working-directory: build + run: cmake -DSHIPPING=ON -DCMAKE_TOOLCHAIN_FILE="../vcpkg/scripts/buildsystems/vcpkg.cmake" .. + - name: CMake Build + working-directory: build + run: cmake --build . config=Release build-windows: runs-on: windows-latest steps: @@ -34,18 +33,17 @@ jobs: - name: Get Microsoft Visual Studio for C++ uses: ilammy/msvc-dev-cmd@v1 - name: Install CMake - uses: lukka/get-cmake@latest - - name: Install Vcpkg Packages - uses: lukka/run-vcpkg@v11 - with: - vcpkgJsonGlob: 'vcpkg.json' - - name: Configure and Build - uses: lukka/run-cmake@v10 - with: - configurePreset: 'msvc-vcpkg' - buildPreset: 'msvc-vcpkg-release' + uses: lukka/get-cmake@v3.27.6 + - name: Create Build Dir + run: mkdir build + - name: CMake Configure + working-directory: build + run: cmake -DSHIPPING=ON -DCMAKE_TOOLCHAIN_FILE="../vcpkg/scripts/buildsystems/vcpkg.cmake" .. + - name: CMake Build + working-directory: build + run: cmake --build . config=Release - name: Upload Artifiacts uses: actions/upload-artifact@v4 with: name: windows-build - path: builds/msvc-vcpkg/Release + path: build/Release diff --git a/.gitignore b/.gitignore index 13a67c8..19832b2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ meta-quest/ovr_openxr_mobile_sdk_59.0.zip data/* !data/test.ply !data/test_vr.json +vcpkg_installed/ # ignore archived release zip splatapult*.zip diff --git a/CMakePresets.json b/CMakePresets.json deleted file mode 100644 index 52d568f..0000000 --- a/CMakePresets.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "$schema": "https://cmake.org/cmake/help/latest/_downloads/3e2d73bff478d88a7de0de736ba5e361/schema.json", - "version": 8, - "cmakeMinimumRequired": { - "major": 3, - "minor": 21, - "patch": 0 - }, - "configurePresets": [ - { - "name": "make-vcpkg", - "displayName": "Unix Make Config", - "description": "Configure with vcpkg toolchain and generate makefile", - "binaryDir": "${sourceDir}/builds/${presetName}", - "generator": "Unix Makefiles", - "toolchainFile": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", - "cacheVariables": { - "SHIPPING": "ON" - } - }, - { - "name": "msvc-vcpkg", - "displayName": "Microsoft Visual Studio Config", - "description": "Configure with vcpkg toolchain and generate Visual Studio solution", - "binaryDir": "${sourceDir}/builds/${presetName}", - "generator": "Visual Studio 17 2022", - "toolchainFile": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", - "cacheVariables": { - "SHIPPING": "ON" - } - } - ], - "buildPresets": [ - { - "name": "make-vcpkg-release", - "configurePreset": "make-vcpkg", - "displayName": "Build (Release)", - "description": "Build with Make/vcpkg (Release)", - "configuration": "Release" - }, - { - "name": "msvc-vcpkg-release", - "configurePreset": "msvc-vcpkg", - "displayName": "Build (Release)", - "description": "Build with msvc/vcpkg (Release)", - "configuration": "Release" - } - ] -} diff --git a/tasks.py b/tasks.py index beae415..7a4a298 100644 --- a/tasks.py +++ b/tasks.py @@ -4,39 +4,31 @@ RELEASE_NAME = "splatapult-0.1-x64" -VCPKG_DIR = os.getenv("VCPKG_DIR") - @task def clean(c): + c.run("rm -rf vcpkg_installed") c.run("rm -rf build") - -@task -def build(c): +def build_with_config(c, config): c.run("mkdir build") + with c.cd("build"): - c.run( - f'cmake -DSHIPPING=ON -DCMAKE_TOOLCHAIN_FILE="{VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake" ..' - ) - c.run(f"cmake --build . --config Release") + c.run('cmake -DSHIPPING=ON -DCMAKE_TOOLCHAIN_FILE="../vcpkg/scripts/buildsystems/vcpkg.cmake" ..') + c.run(f"cmake --build . --config={config}") +@task +def build(c): + build_with_config(c, "Release") @task def build_debug(c): - c.run("mkdir build") - with c.cd("build"): - c.run( - f'cmake -DSHIPPING=OFF -DCMAKE_TOOLCHAIN_FILE="{VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake" ..' - ) - c.run(f"cmake --build . --config Debug") - + build_with_config(c, "Debug") @task def archive(c): shutil.make_archive(RELEASE_NAME, "zip", "build/Release") - @task def deploy(c): c.run(f"cp {RELEASE_NAME}.zip ../hyperlogic.github.io/files") diff --git a/vcpkg b/vcpkg index ab887c5..1b2372f 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit ab887c562326c686478284d9076d722c1ec4b48c +Subproject commit 1b2372fdd420185c6f516541b81228c55061dca4