Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update third party dependencies to vcpkg #909

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Cache vcpkg artifacts
uses: actions/cache@v3
env:
cache-name: cache-vcpkg-${{ runner.os }}-${{ hashFiles('CMakeLists.txt') }}
with:
path: ~/.ezvcpkg
key: build-${{ env.cache-name }}
restore-keys: |
build-${{ env.cache-name }}
build-cache-vcpkg-${{ runner.os }}-
- if: ${{ matrix.platform == 'ubuntu' }}
name: Install RandR headers
run: |
Expand Down Expand Up @@ -64,6 +74,16 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Cache vcpkg artifacts
uses: actions/cache@v3
env:
cache-name: cache-vcpkg-${{ runner.os }}-${{ hashFiles('CMakeLists.txt') }}
with:
path: ~/.ezvcpkg
key: build-${{ env.cache-name }}
restore-keys: |
build-${{ env.cache-name }}
build-cache-vcpkg-${{ runner.os }}-
- name: Install RandR headers
run: |
sudo apt-get update
Expand All @@ -89,6 +109,16 @@ jobs:
with:
submodules: "recursive"

- name: Cache vcpkg artifacts
uses: actions/cache@v3
env:
cache-name: cache-vcpkg-android-${{ hashFiles('CMakeLists.txt') }}
with:
path: ~/.ezvcpkg
key: build-${{ env.cache-name }}
restore-keys: |
build-${{ env.cache-name }}
build-cache-vcpkg-android-
- name: set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,17 @@ jobs:
container: ghcr.io/khronosgroupactions/clang-tools:15.0.0
runs-on: ubuntu-latest
needs: changed-files
env:
VCPKG_FORCE_SYSTEM_BINARIES: 1
continue-on-error: true # we currently don't track clang-tidy warnings as errors. in the future this will change
if: ${{needs.changed-files.outputs.all}}
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: "Install zip (required by vcpkg)"
run: apk add build-base cmake ninja zip unzip curl git
- run: git config --global --add safe.directory /__w/Vulkan-Samples/Vulkan-Samples
- run: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -Bbuild/clang
- run: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DVKB_WSI_SELECTION=D2D -Bbuild/clang
- run: |
/usr/bin/run-clang-tidy -j $(($(nproc)/2+1)) -p build/clang -header-filter=framework,samples,app -checks=-*,google-*,-google-runtime-references -quiet ${{ needs.changed-files.outputs.all }}
11 changes: 10 additions & 1 deletion .github/workflows/external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Cache vcpkg artifacts
uses: actions/cache@v3
env:
cache-name: cache-vcpkg-${{ runner.os }}-${{ hashFiles('CMakeLists.txt') }}
with:
path: ~/.ezvcpkg
key: build-${{ env.cache-name }}
restore-keys: |
build-${{ env.cache-name }}
build-cache-vcpkg-${{ runner.os }}-
- if: ${{ matrix.platform == 'ubuntu' }}
name: Install RandR headers
run: |
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Cache vcpkg artifacts
uses: actions/cache@v3
env:
cache-name: cache-vcpkg-${{ runner.os }}-${{ hashFiles('CMakeLists.txt') }}
with:
path: ~/.ezvcpkg
key: build-${{ env.cache-name }}
restore-keys: |
build-${{ env.cache-name }}
build-cache-vcpkg-${{ runner.os }}-
- if: ${{ matrix.platform == 'ubuntu' }}
name: Install RandR headers
run: |
Expand Down
33 changes: 0 additions & 33 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,36 +1,12 @@
[submodule "third_party/volk"]
path = third_party/volk
url = https://github.com/zeux/volk
[submodule "third_party/glm"]
path = third_party/glm
url = https://github.com/g-truc/glm
[submodule "third_party/stb"]
path = third_party/stb
url = https://github.com/nothings/stb
[submodule "third_party/imgui"]
path = third_party/imgui
url = https://github.com/ocornut/imgui
[submodule "third_party/tinygltf"]
path = third_party/tinygltf
url = https://github.com/syoyo/tinygltf
[submodule "third_party/glfw"]
path = third_party/glfw
url = https://github.com/glfw/glfw
[submodule "third_party/glslang"]
path = third_party/glslang
url = https://github.com/KhronosGroup/glslang
[submodule "third_party/spirv-cross"]
path = third_party/spirv-cross
url = https://github.com/KhronosGroup/SPIRV-Cross
[submodule "third_party/hwcpipe"]
path = third_party/hwcpipe
url = https://github.com/ARM-software/HWCPipe
[submodule "third_party/vma"]
path = third_party/vma
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
[submodule "third_party/spdlog"]
path = third_party/spdlog
url = https://github.com/gabime/spdlog
[submodule "third_party/ktx"]
path = third_party/ktx
url = https://github.com/KhronosGroup/KTX-Software
Expand All @@ -47,15 +23,6 @@
path = assets
url = https://github.com/KhronosGroup/Vulkan-Samples-Assets
shallow = true
[submodule "third_party/cli11"]
path = third_party/cli11
url = https://github.com/CLIUtils/CLI11.git
[submodule "third_party/opencl"]
path = third_party/opencl
url = https://github.com/KhronosGroup/OpenCL-Headers.git
[submodule "third_party/catch2"]
path = third_party/catch2
url = https://github.com/catchorg/Catch2.git
[submodule "third_party/fmt"]
path = third_party/fmt
url = https://github.com/fmtlib/fmt
49 changes: 47 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,55 @@ endif()

cmake_minimum_required(VERSION 3.16)

# globally add VKB_DEBUG for the debug build
add_compile_definitions($<$<CONFIG:DEBUG>:VKB_DEBUG>)
set(VCPKG_PACKAGES catch2 cli11 fmt glm glslang imgui spdlog spirv-cross stb tinygltf vulkan-memory-allocator)
include(${CMAKE_CURRENT_SOURCE_DIR}/bldsys/cmake/ezvcpkg.cmake)
set(VCPKG_LIBRARY_LINKAGE static)
if (CMAKE_SYSTEM_NAME STREQUAL "Android")
set(VCPKG_TARGET_TRIPLET "arm64-android")
elseif(NOT (VKB_WSI_SELECTION STREQUAL D2D))
list(APPEND VCPKG_PACKAGES glfw3)
endif()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

ezvcpkg_fetch(
COMMIT 2024.01.12
PACKAGES ${VCPKG_PACKAGES}
CLEAN_BUILDTREES
)
list(APPEND CMAKE_PREFIX_PATH ${EZVCPKG_DIR} ${EZVCPKG_DIR}/share)

if (CMAKE_SYSTEM_NAME STREQUAL "Android")
# Android's build system freaks out if the toolchain is updated (even though CMake runs successfully,
# the wrapping build system can't seem to parse the output), but also can't find the bulk of these
# packages without special help otherwise, so we're giving it a hand here.
set(fmt_DIR ${EZVCPKG_DIR}/share/fmt)
set(spdlog_DIR ${EZVCPKG_DIR}/share/spdlog)
set(imgui_DIR ${EZVCPKG_DIR}/share/imgui)
set(CLI11_DIR ${EZVCPKG_DIR}/share/cli11)
set(spirv_cross_core_DIR ${EZVCPKG_DIR}/share/spirv_cross_core)
set(spirv_cross_glsl_DIR ${EZVCPKG_DIR}/share/spirv_cross_glsl)
else()
find_package(Catch2 CONFIG REQUIRED)
# These packages aren't stricktly required, because they're header only libraries and we already get the
# main vcpkg header path from all the other packages. However, they lack actual CMake config files
# and so we can't find them in the Android setup
find_package(VulkanMemoryAllocator CONFIG REQUIRED)
find_package(glm CONFIG REQUIRED)
if (NOT (VKB_WSI_SELECTION STREQUAL D2D))
find_package(glfw3 CONFIG)
endif()
endif()

project(vulkan_samples)
find_package(fmt CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(imgui CONFIG REQUIRED)
find_package(CLI11 CONFIG REQUIRED)
find_package(spirv_cross_core CONFIG REQUIRED)
find_package(spirv_cross_glsl CONFIG REQUIRED)

# globally add VKB_DEBUG for the debug build
add_compile_definitions($<$<CONFIG:DEBUG>:VKB_DEBUG>)

if(MSVC AND (DEFINED CMAKE_C_COMPILER_LAUNCHER))
message(DEBUG "Setting MSVC flags to /Z7 for ccache compatibility. Current flags: ${CMAKE_CXX_FLAGS_DEBUG}")
Expand Down
Loading
Loading