From ba8bc2904894d1c473a77fef7c79090697cfc29c Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:04:39 +0900 Subject: [PATCH 01/37] WIP: Add CI. --- .github/workflows/linux.yml | 24 ++++++++++++++++++++++++ .github/workflows/windows.yml | 25 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..f626bb7 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,24 @@ +name: Linux + +env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + +on: + push: + paths: + - '**' + - '!README.md' + - '!LICENSE.txt' + - '!doc/**' + - '!.github/workflows/**' + - '.github/workflows/linux.yml' +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - name: Install Vulkan SDK + uses: humbletim/setup-vulkan-sdk@v1.2.0 + with: + vulkan-query-version: latest + vulkan-components: Vulkan-Headers, Vulkan-Loader + vulkan-use-cache: true \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..201a059 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,25 @@ +name: Windows + +env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + +on: + push: + paths: + - '**' + - '!README.md' + - '!LICENSE.txt' + - '!doc/**' + - '!.github/workflows/**' + - '.github/workflows/windows.yml' + +jobs: + build: + runs-on: windows-latest + steps: + - name: Install Vulkan SDK + uses: humbletim/setup-vulkan-sdk@v1.2.0 + with: + vulkan-query-version: latest + vulkan-components: Vulkan-Headers, Vulkan-Loader + vulkan-use-cache: true From 6de0482a3c0dd3349b9e4e4288439d3cc13191fc Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:11:09 +0900 Subject: [PATCH 02/37] WIP: Add CI. --- .github/workflows/linux.yml | 24 +++++++++++++++++++++++- .github/workflows/windows.yml | 22 ++++++++++++++++++++++ CMakeLists.txt | 10 +++++++++- CMakePresets.json | 11 ++++++++++- 4 files changed, 64 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index f626bb7..f56adb2 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -12,13 +12,35 @@ on: - '!doc/**' - '!.github/workflows/**' - '.github/workflows/linux.yml' + jobs: build: runs-on: ubuntu-24.04 steps: + - uses: actions/checkout@v4 + - name: Install Vulkan SDK uses: humbletim/setup-vulkan-sdk@v1.2.0 with: vulkan-query-version: latest vulkan-components: Vulkan-Headers, Vulkan-Loader - vulkan-use-cache: true \ No newline at end of file + vulkan-use-cache: true + + - name: Install Ninja + run: | + sudo apt-get install ninja-build + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Configure + run: | + mkdir build + cmake --preset=vcpkg + + - name: Build + run: cmake --build build --config release \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 201a059..8063791 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -17,9 +17,31 @@ jobs: build: runs-on: windows-latest steps: + - uses: actions/checkout@v4 + + - name: Enable Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1 + with: + toolset: 14.40 + - name: Install Vulkan SDK uses: humbletim/setup-vulkan-sdk@v1.2.0 with: vulkan-query-version: latest vulkan-components: Vulkan-Headers, Vulkan-Loader vulkan-use-cache: true + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Configure + run: | + mkdir build + cmake --preset=vcpkg + + - name: Build + run: cmake --build build --config release \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index a53a93e..9bc68d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,15 @@ set(CMAKE_CXX_MODULE_STD 1) find_package(glfw3 CONFIG REQUIRED) find_package(glm CONFIG REQUIRED) -find_package(vku CONFIG REQUIRED) + +include(FetchContent) +FetchContent_Declare( + vku + GIT_REPOSITORY https://github.com/stripe2933/vku.git + GIT_TAG module + FIND_PACKAGE_ARGS +) +FetchContent_MakeAvailable(vku) # ---------------- # Module configurations for external dependencies. diff --git a/CMakePresets.json b/CMakePresets.json index 97de509..6f34e84 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -5,7 +5,16 @@ "name": "default", "displayName": "Default", "generator": "Ninja", - "binaryDir": "${sourceDir}/build/${presetName}" + "binaryDir": "${sourceDir}/build" + }, + { + "name": "vcpkg", + "displayName": "vcpkg-based dependency management", + "inherits": "default", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "VCPKG_OVERLAY_PORTS": "${sourceDir}/overlays" + } } ] } \ No newline at end of file From 21aeb348a079f973e615628ce6d8121b7e819959 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:15:31 +0900 Subject: [PATCH 03/37] WIP: Add CI. --- .github/workflows/linux.yml | 4 +++- vcpkg-configuration.json | 14 ++++++++++++++ vcpkg.json | 7 +++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 vcpkg-configuration.json create mode 100644 vcpkg.json diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index f56adb2..9441c00 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -40,7 +40,9 @@ jobs: - name: Configure run: | mkdir build - cmake --preset=vcpkg + cmake --preset=vcpkg \ + -DCMAKE_C_COMPILER="/usr/bin/clang-18" \ + -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ - name: Build run: cmake --build build --config release \ No newline at end of file diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 0000000..6089827 --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,14 @@ +{ + "default-registry": { + "kind": "git", + "baseline": "7aeffc91033ad35cc4e2c152f213a866ec6c11ac", + "repository": "https://github.com/microsoft/vcpkg" + }, + "registries": [ + { + "kind": "artifact", + "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", + "name": "microsoft" + } + ] +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..5b26392 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,7 @@ +{ + "dependencies": [ + "vulkan-memory-allocator-hpp", + "glm", + "glfw3" + ] +} From 3aa75ed673a0752fc361ba7aca99f84c0a49f76b Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:18:28 +0900 Subject: [PATCH 04/37] WIP: Add CI. --- .github/workflows/linux.yml | 1 + .github/workflows/windows.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9441c00..8b31fb2 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -43,6 +43,7 @@ jobs: cmake --preset=vcpkg \ -DCMAKE_C_COMPILER="/usr/bin/clang-18" \ -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ + -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" - name: Build run: cmake --build build --config release \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8063791..b1a6a0c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -41,7 +41,8 @@ jobs: - name: Configure run: | mkdir build - cmake --preset=vcpkg + cmake --preset=vcpkg ` + -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" - name: Build run: cmake --build build --config release \ No newline at end of file From 15552fe84affe05a7c2c9d9c2d7ca0eff36a8d7f Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:19:56 +0900 Subject: [PATCH 05/37] WIP: Add CI. --- .github/workflows/linux.yml | 2 +- .github/workflows/windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8b31fb2..13b600c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -43,7 +43,7 @@ jobs: cmake --preset=vcpkg \ -DCMAKE_C_COMPILER="/usr/bin/clang-18" \ -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ - -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" + -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" - name: Build run: cmake --build build --config release \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b1a6a0c..2efe193 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -42,7 +42,7 @@ jobs: run: | mkdir build cmake --preset=vcpkg ` - -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" + -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" - name: Build run: cmake --build build --config release \ No newline at end of file From 86d81f09baee9765d2bcfc7e43b536024b63f139 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:21:14 +0900 Subject: [PATCH 06/37] WIP: Add CI. --- overlays/vulkan/portfile.cmake | 1 + overlays/vulkan/vcpkg.json | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 overlays/vulkan/portfile.cmake create mode 100644 overlays/vulkan/vcpkg.json diff --git a/overlays/vulkan/portfile.cmake b/overlays/vulkan/portfile.cmake new file mode 100644 index 0000000..0015715 --- /dev/null +++ b/overlays/vulkan/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/overlays/vulkan/vcpkg.json b/overlays/vulkan/vcpkg.json new file mode 100644 index 0000000..efefaf9 --- /dev/null +++ b/overlays/vulkan/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "vulkan", + "version": "1.3.283" +} \ No newline at end of file From 0039a712f630ca6a7836f6340dde3e422c264164 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:26:46 +0900 Subject: [PATCH 07/37] WIP: Add CI. --- .github/workflows/linux.yml | 4 ++-- CMakeLists.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 13b600c..5f27bf6 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -26,9 +26,9 @@ jobs: vulkan-components: Vulkan-Headers, Vulkan-Loader vulkan-use-cache: true - - name: Install Ninja + - name: Install Ninja and GLFW dependencies run: | - sudo apt-get install ninja-build + sudo apt-get install ninja-build xinerama xcursor xorg libglu1-mesa pkg-config - name: Export GitHub Actions cache environment variables uses: actions/github-script@v7 diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bc68d3..830e6fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ FetchContent_Declare( vku GIT_REPOSITORY https://github.com/stripe2933/vku.git GIT_TAG module + PATCH_COMMAND git apply ${vku_SOURCE_DIR}/vcpkg-deps.patch FIND_PACKAGE_ARGS ) FetchContent_MakeAvailable(vku) From 6ac1d2de8b6c4858505d5899d425e265018ad856 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:33:04 +0900 Subject: [PATCH 08/37] WIP: Add CI. --- .github/workflows/linux.yml | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5f27bf6..77e4260 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -28,7 +28,7 @@ jobs: - name: Install Ninja and GLFW dependencies run: | - sudo apt-get install ninja-build xinerama xcursor xorg libglu1-mesa pkg-config + sudo apt-get install ninja-build xorg-dev - name: Export GitHub Actions cache environment variables uses: actions/github-script@v7 diff --git a/CMakeLists.txt b/CMakeLists.txt index 830e6fe..872b714 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ FetchContent_Declare( vku GIT_REPOSITORY https://github.com/stripe2933/vku.git GIT_TAG module - PATCH_COMMAND git apply ${vku_SOURCE_DIR}/vcpkg-deps.patch + PATCH_COMMAND git apply ${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch # TODO: avoid hardcoded path! FIND_PACKAGE_ARGS ) FetchContent_MakeAvailable(vku) From df248517d9d2e16663f9bbf0cc6936335c655532 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:42:54 +0900 Subject: [PATCH 09/37] WIP: Add CI. --- .github/workflows/linux.yml | 14 ++++++++++++++ .github/workflows/windows.yml | 12 ++++++++++++ CMakeLists.txt | 11 +---------- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 77e4260..3b9cf65 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -37,6 +37,20 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Install vku + run: | + git clone https://github.com/stripe2933/vku.git + cd vku + git checkout branch + git apply vcpkg-deps.patch + cmake -S . -B build -G Ninja \ + -DCMAKE_C_COMPILER="/usr/bin/clang-18" \ + -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ + -DVCPKG_OVERLAY_PORTS=overlays + sudo cmake --build build --target install --config release + - name: Configure run: | mkdir build diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2efe193..14c82e5 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -38,6 +38,18 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Install vku + run: | + git clone https://github.com/stripe2933/vku.git + cd vku + git checkout branch + git apply vcpkg-deps.patch + cmake -S . -B build -G Ninja ` + -DCMAKE_BUILD_TYPE=Release ` + -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" ` + -DVCPKG_OVERLAY_PORTS=overlays + cmake --build build --target install --config release + - name: Configure run: | mkdir build diff --git a/CMakeLists.txt b/CMakeLists.txt index 872b714..a53a93e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,16 +14,7 @@ set(CMAKE_CXX_MODULE_STD 1) find_package(glfw3 CONFIG REQUIRED) find_package(glm CONFIG REQUIRED) - -include(FetchContent) -FetchContent_Declare( - vku - GIT_REPOSITORY https://github.com/stripe2933/vku.git - GIT_TAG module - PATCH_COMMAND git apply ${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch # TODO: avoid hardcoded path! - FIND_PACKAGE_ARGS -) -FetchContent_MakeAvailable(vku) +find_package(vku CONFIG REQUIRED) # ---------------- # Module configurations for external dependencies. From 6f8b68a6f46141876322308b5eb61f1cdb645785 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:45:43 +0900 Subject: [PATCH 10/37] WIP: Add CI. --- .github/workflows/linux.yml | 2 +- .github/workflows/windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 3b9cf65..9839ee2 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -41,7 +41,7 @@ jobs: run: | git clone https://github.com/stripe2933/vku.git cd vku - git checkout branch + git checkout module git apply vcpkg-deps.patch cmake -S . -B build -G Ninja \ -DCMAKE_C_COMPILER="/usr/bin/clang-18" \ diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 14c82e5..2763d8e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -42,7 +42,7 @@ jobs: run: | git clone https://github.com/stripe2933/vku.git cd vku - git checkout branch + git checkout module git apply vcpkg-deps.patch cmake -S . -B build -G Ninja ` -DCMAKE_BUILD_TYPE=Release ` From 5ab772ed581c60d14eddd3d838d4de392eabad85 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:48:48 +0900 Subject: [PATCH 11/37] WIP: Add CI. --- .github/workflows/linux.yml | 4 +++- .github/workflows/windows.yml | 2 +- vcpkg.json | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9839ee2..91162df 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -57,7 +57,9 @@ jobs: cmake --preset=vcpkg \ -DCMAKE_C_COMPILER="/usr/bin/clang-18" \ -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ - -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" + -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ + -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ + -DCMAKE_EXE_LINKER_FLAGS="-lc++" - name: Build run: cmake --build build --config release \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2763d8e..cc2233e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -46,7 +46,7 @@ jobs: git apply vcpkg-deps.patch cmake -S . -B build -G Ninja ` -DCMAKE_BUILD_TYPE=Release ` - -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" ` + -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" ` -DVCPKG_OVERLAY_PORTS=overlays cmake --build build --target install --config release diff --git a/vcpkg.json b/vcpkg.json index 5b26392..325ad9a 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,5 @@ { "dependencies": [ - "vulkan-memory-allocator-hpp", "glm", "glfw3" ] From cdc1ddf52f16c2ab165d0b330c6a99f3384aff5d Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:55:20 +0900 Subject: [PATCH 12/37] WIP: Add CI. --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 91162df..fe211a6 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -59,7 +59,7 @@ jobs: -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ - -DCMAKE_EXE_LINKER_FLAGS="-lc++" + -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" - name: Build run: cmake --build build --config release \ No newline at end of file From e98fd6a77612f2c26d603762775ca73b46c75845 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 04:58:15 +0900 Subject: [PATCH 13/37] WIP: Add CI. --- .github/workflows/linux.yml | 9 ++++++--- .github/workflows/windows.yml | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index fe211a6..a9ff6c7 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -26,9 +26,9 @@ jobs: vulkan-components: Vulkan-Headers, Vulkan-Loader vulkan-use-cache: true - - name: Install Ninja and GLFW dependencies + - name: Install Ninja and build dependencies run: | - sudo apt-get install ninja-build xorg-dev + sudo apt-get install ninja-build xorg-dev libc++-dev libc++abi-dev - name: Export GitHub Actions cache environment variables uses: actions/github-script@v7 @@ -48,7 +48,10 @@ jobs: -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ - -DVCPKG_OVERLAY_PORTS=overlays + -DVCPKG_OVERLAY_PORTS=overlays \ + -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ + -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" + -DVKU_USE_STD_MODULE=ON sudo cmake --build build --target install --config release - name: Configure diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index cc2233e..1a06a27 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -47,7 +47,8 @@ jobs: cmake -S . -B build -G Ninja ` -DCMAKE_BUILD_TYPE=Release ` -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" ` - -DVCPKG_OVERLAY_PORTS=overlays + -DVCPKG_OVERLAY_PORTS=overlays ` + -DVKU_USE_STD_MODULE=ON cmake --build build --target install --config release - name: Configure From 9577b10227979fed950d48a60fcf4d7585dd4ca3 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 05:01:23 +0900 Subject: [PATCH 14/37] WIP: Add CI. --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a9ff6c7..34930f2 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -50,7 +50,7 @@ jobs: -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ -DVCPKG_OVERLAY_PORTS=overlays \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ - -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" + -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" \ -DVKU_USE_STD_MODULE=ON sudo cmake --build build --target install --config release From 0a369db617da9630aec4f36b1b80a24d9ea9b07a Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 18:27:38 +0900 Subject: [PATCH 15/37] WIP: Add CI. --- .github/workflows/linux.yml | 20 ++------------------ .github/workflows/windows.yml | 18 +++--------------- CMakeLists.txt | 13 ++++++++++++- vcpkg.json | 3 ++- 4 files changed, 19 insertions(+), 35 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 34930f2..66a3790 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -37,30 +37,14 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Install vku - run: | - git clone https://github.com/stripe2933/vku.git - cd vku - git checkout module - git apply vcpkg-deps.patch - cmake -S . -B build -G Ninja \ - -DCMAKE_C_COMPILER="/usr/bin/clang-18" \ - -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ - -DVCPKG_OVERLAY_PORTS=overlays \ - -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ - -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" \ - -DVKU_USE_STD_MODULE=ON - sudo cmake --build build --target install --config release - - name: Configure run: | - mkdir build cmake --preset=vcpkg \ -DCMAKE_C_COMPILER="/usr/bin/clang-18" \ -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ + -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ + -DVCPKG_OVERLAY_PORTS=overlays \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1a06a27..f1cefd6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -38,24 +38,12 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Install vku - run: | - git clone https://github.com/stripe2933/vku.git - cd vku - git checkout module - git apply vcpkg-deps.patch - cmake -S . -B build -G Ninja ` - -DCMAKE_BUILD_TYPE=Release ` - -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" ` - -DVCPKG_OVERLAY_PORTS=overlays ` - -DVKU_USE_STD_MODULE=ON - cmake --build build --target install --config release - - name: Configure run: | - mkdir build cmake --preset=vcpkg ` - -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" + -DCMAKE_BUILD_TYPE=Release ` + -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" ` + -DVCPKG_OVERLAY_PORTS=overlays - name: Build run: cmake --build build --config release \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index a53a93e..4b488f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,18 @@ set(CMAKE_CXX_MODULE_STD 1) find_package(glfw3 CONFIG REQUIRED) find_package(glm CONFIG REQUIRED) -find_package(vku CONFIG REQUIRED) + +include(FetchContent) + +set(VKU_USE_STD_MODULE ON) +FetchContent_Declare( + vku + GIT_REPOSITORY https://github.com/stripe2933/vku.git + GIT_TAG module + PATCH_COMMAND git apply ${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch + UPDATE_DISCONNECTED 1 +) +FetchContent_MakeAvailable(vku) # ---------------- # Module configurations for external dependencies. diff --git a/vcpkg.json b/vcpkg.json index 325ad9a..7fba94c 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,7 @@ { "dependencies": [ + "glfw3", "glm", - "glfw3" + "vulkan-memory-allocator-hpp" ] } From 6274e7e574be027ae07383419f1793ca292ac11c Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 18:30:57 +0900 Subject: [PATCH 16/37] MSVC C++20 module specific fixes. --- descriptor_set_layouts.cppm | 3 +++ pipelines.cppm | 3 +++ render_passes.cppm | 3 +++ 3 files changed, 9 insertions(+) diff --git a/descriptor_set_layouts.cppm b/descriptor_set_layouts.cppm index 585b75f..6d835a2 100644 --- a/descriptor_set_layouts.cppm +++ b/descriptor_set_layouts.cppm @@ -1,5 +1,8 @@ export module vk_deferred:descriptor_set_layouts; +#ifdef _MSC_VER +import std; +#endif import vku; export struct DeferredLightRendererDescriptorSetLayout final : vku::DescriptorSetLayouts<2> { diff --git a/pipelines.cppm b/pipelines.cppm index 0d09ac7..72fc30f 100644 --- a/pipelines.cppm +++ b/pipelines.cppm @@ -1,5 +1,8 @@ export module vk_deferred:pipelines; +#ifdef _MSC_VER +import std; +#endif export import glm; export import vulkan_hpp; import vku; diff --git a/render_passes.cppm b/render_passes.cppm index 58414ff..57429d3 100644 --- a/render_passes.cppm +++ b/render_passes.cppm @@ -1,5 +1,8 @@ export module vk_deferred:render_passes; +#ifdef _MSC_VER +import std; +#endif import vku; export import vulkan_hpp; From cedaef6d82f5fba26b3312ba42b23b2013611cbb Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 18:40:49 +0900 Subject: [PATCH 17/37] Use CPM.cmake to manage dependency. --- CMakeLists.txt | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b488f8..fadaac8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,15 @@ project(vk-deferred LANGUAGES CXX) set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_MODULE_STD 1) +# ---------------- +# Include CPM.cmake. +# ---------------- + +file(DOWNLOAD https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/get_cpm.cmake + ${CMAKE_CURRENT_BINARY_DIR}/CPM.cmake +) +include(${CMAKE_CURRENT_BINARY_DIR}/CPM.cmake) + # ---------------- # External dependencies. # ---------------- @@ -15,17 +24,13 @@ set(CMAKE_CXX_MODULE_STD 1) find_package(glfw3 CONFIG REQUIRED) find_package(glm CONFIG REQUIRED) -include(FetchContent) - -set(VKU_USE_STD_MODULE ON) -FetchContent_Declare( - vku - GIT_REPOSITORY https://github.com/stripe2933/vku.git +CPMAddPackage( + NAME vku + GITHUB_REPOSITORY stripe2933/vku GIT_TAG module - PATCH_COMMAND git apply ${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch - UPDATE_DISCONNECTED 1 + PATCHES ${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch + OPTIONS "VKU_USE_STD_MODULE ON" ) -FetchContent_MakeAvailable(vku) # ---------------- # Module configurations for external dependencies. From 565226b1736eceb8368b8ccb0e92cbf527277b6a Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 18:52:25 +0900 Subject: [PATCH 18/37] Apply patch only if USE_VCPKG enabled. --- CMakeLists.txt | 2 +- CMakePresets.json | 3 ++- README.md | 11 +++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fadaac8..377a8b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ CPMAddPackage( NAME vku GITHUB_REPOSITORY stripe2933/vku GIT_TAG module - PATCHES ${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch + $<$:PATCHES ${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch> # Apply patch if USE_VCPKG enabled. OPTIONS "VKU_USE_STD_MODULE ON" ) diff --git a/CMakePresets.json b/CMakePresets.json index 6f34e84..b18f3f1 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -13,7 +13,8 @@ "inherits": "default", "cacheVariables": { "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "VCPKG_OVERLAY_PORTS": "${sourceDir}/overlays" + "VCPKG_OVERLAY_PORTS": "${sourceDir}/overlays", + "USE_VCPKG": "ON" } } ] diff --git a/README.md b/README.md index fdfb262..ad53ca5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # vk-deferred +![Linux](https://github.com/stripe2933/vk-deferred/actions/workflows/linux.yml/badge.svg) +![Windows](https://github.com/stripe2933/vk-deferred/actions/workflows/windows.yml/badge.svg) + ![Running screenshot](doc/images/running-screenshot.png) A minimal Vulkan deferred rendering demonstration. @@ -8,7 +11,7 @@ A minimal Vulkan deferred rendering demonstration. This project requires support for C++20 modules and the C++23 standard library. The supported compiler is: - Clang 18.1.2 -- ~~MSVC 19.40 (Older versions may fail to compile due to various MSVC module bugs)~~ (currently being tested) +- ~~MSVC 19.40 (Older versions may fail to compile due to various MSVC module bugs)~~ (currently not working with internal compiler error: I'll investigate it!) Additionally, the following build tools are required: - CMake 3.30 @@ -19,9 +22,9 @@ Additionally, the following build tools are required: This project depends on: - [GLFW](https://github.com/glfw/glfw) - [glm](https://github.com/g-truc/glm) -- [Vulkan-Hpp](https://github.com/KhronosGroup/Vulkan-Hpp) -- [VulkanMemoryAllocator-Hpp](https://github.com/YaaZ/VulkanMemoryAllocator-Hpp) -- My own Vulkan-Hpp helper library, [vku](https://github.com/stripe2933/vku/tree/module) (branch `module`) +- My own Vulkan-Hpp helper library, [vku](https://github.com/stripe2933/vku/tree/module) (branch `module`), which has the following dependencies: + - [Vulkan-Hpp](https://github.com/KhronosGroup/Vulkan-Hpp) + - [VulkanMemoryAllocator-Hpp](https://github.com/YaaZ/VulkanMemoryAllocator-Hpp) ### Build Steps From 4d5dccbaa9e72a3695422fd011539eb1b9ec39a5 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 18:55:21 +0900 Subject: [PATCH 19/37] Apply patch only if USE_VCPKG enabled. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 377a8b4..92a8f1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ CPMAddPackage( NAME vku GITHUB_REPOSITORY stripe2933/vku GIT_TAG module - $<$:PATCHES ${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch> # Apply patch if USE_VCPKG enabled. + $<$:"PATCHES ${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch"> # Apply patch if USE_VCPKG enabled. OPTIONS "VKU_USE_STD_MODULE ON" ) From 50eb89cba7fe0e411cca413953775aeec414803b Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Sun, 21 Jul 2024 19:02:50 +0900 Subject: [PATCH 20/37] Apply patch only if USE_VCPKG enabled. --- .github/workflows/linux.yml | 1 - .github/workflows/windows.yml | 3 +-- CMakeLists.txt | 5 ++++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 66a3790..5a7ced7 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -44,7 +44,6 @@ jobs: -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ - -DVCPKG_OVERLAY_PORTS=overlays \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f1cefd6..7af91f0 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -42,8 +42,7 @@ jobs: run: | cmake --preset=vcpkg ` -DCMAKE_BUILD_TYPE=Release ` - -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" ` - -DVCPKG_OVERLAY_PORTS=overlays + -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" - name: Build run: cmake --build build --config release \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 92a8f1d..3fa0f7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,11 +24,14 @@ include(${CMAKE_CURRENT_BINARY_DIR}/CPM.cmake) find_package(glfw3 CONFIG REQUIRED) find_package(glm CONFIG REQUIRED) +if (USE_VCPKG) + set(VCPKG_PATCH_FILE "${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch") +endif() CPMAddPackage( NAME vku GITHUB_REPOSITORY stripe2933/vku GIT_TAG module - $<$:"PATCHES ${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch"> # Apply patch if USE_VCPKG enabled. + PATCHES ${VCPKG_PATCH_FILE} # Apply patch if USE_VCPKG enabled. OPTIONS "VKU_USE_STD_MODULE ON" ) From 97ae723166bb3d337eb7d18da2b91fbbabf5fea2 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 00:13:19 +0900 Subject: [PATCH 21/37] Use vku with vcpkg overlays. --- CMakeLists.txt | 12 +--------- CMakePresets.json | 3 +-- overlays/vku/portfile.cmake | 26 +++++++++++++++++++++ overlays/vku/usage | 4 ++++ overlays/vku/vcpkg-deps.patch | 44 +++++++++++++++++++++++++++++++++++ overlays/vku/vcpkg.json | 18 ++++++++++++++ vcpkg.json | 2 +- 7 files changed, 95 insertions(+), 14 deletions(-) create mode 100644 overlays/vku/portfile.cmake create mode 100644 overlays/vku/usage create mode 100644 overlays/vku/vcpkg-deps.patch create mode 100644 overlays/vku/vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fa0f7e..bebadaa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,17 +23,7 @@ include(${CMAKE_CURRENT_BINARY_DIR}/CPM.cmake) find_package(glfw3 CONFIG REQUIRED) find_package(glm CONFIG REQUIRED) - -if (USE_VCPKG) - set(VCPKG_PATCH_FILE "${CMAKE_CURRENT_BINARY_DIR}/_deps/vku-src/vcpkg-deps.patch") -endif() -CPMAddPackage( - NAME vku - GITHUB_REPOSITORY stripe2933/vku - GIT_TAG module - PATCHES ${VCPKG_PATCH_FILE} # Apply patch if USE_VCPKG enabled. - OPTIONS "VKU_USE_STD_MODULE ON" -) +find_package(vku CONFIG REQUIRED) # ---------------- # Module configurations for external dependencies. diff --git a/CMakePresets.json b/CMakePresets.json index b18f3f1..6f34e84 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -13,8 +13,7 @@ "inherits": "default", "cacheVariables": { "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "VCPKG_OVERLAY_PORTS": "${sourceDir}/overlays", - "USE_VCPKG": "ON" + "VCPKG_OVERLAY_PORTS": "${sourceDir}/overlays" } } ] diff --git a/overlays/vku/portfile.cmake b/overlays/vku/portfile.cmake new file mode 100644 index 0000000..d4d2b30 --- /dev/null +++ b/overlays/vku/portfile.cmake @@ -0,0 +1,26 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO stripe2933/vku + REF v0.1.0-test5 + SHA512 e4aa0b0195886dca6ae5a718ab68e1901b014bd430e31dae166fd7ca1308b1eebc041d0b8a261e9aee993e16ee91ac7b1c15910a9cfbfafc179191dfbbbf67a0 + HEAD_REF module + PATCHES vcpkg-deps.patch +) + +# Module project doesn't use header files. +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) + +vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}") +vcpkg_cmake_install() + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/share) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/cmake/vku ${CURRENT_PACKAGES_DIR}/debug/share/vku) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) +file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/vku ${CURRENT_PACKAGES_DIR}/share/vku) + +vcpkg_cmake_config_fixup(PACKAGE_NAME "vku") + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/cmake" "${CURRENT_PACKAGES_DIR}/debug/cmake") + +file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY) diff --git a/overlays/vku/usage b/overlays/vku/usage new file mode 100644 index 0000000..6ee3548 --- /dev/null +++ b/overlays/vku/usage @@ -0,0 +1,4 @@ +vku provides CMake targets: + +find_package(vku CONFIG REQUIRED) +target_link_libraries(main PRIVATE vku::vku) \ No newline at end of file diff --git a/overlays/vku/vcpkg-deps.patch b/overlays/vku/vcpkg-deps.patch new file mode 100644 index 0000000..500f00c --- /dev/null +++ b/overlays/vku/vcpkg-deps.patch @@ -0,0 +1,44 @@ +Subject: [PATCH] vcpkg-based dependency management. +--- +Index: extlibs/module-ports/vk_mem_alloc.cppm +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/extlibs/module-ports/vk_mem_alloc.cppm b/extlibs/module-ports/vk_mem_alloc.cppm +--- a/extlibs/module-ports/vk_mem_alloc.cppm (revision 9ce74395ceab83fe55a4ae8ee8a6b8020e832542) ++++ b/extlibs/module-ports/vk_mem_alloc.cppm (date 1721481973172) +@@ -1,6 +1,6 @@ + module; + #define VMA_IMPLEMENTATION +-#include ++#include + export module vk_mem_alloc_hpp; + + export namespace VMA_HPP_NAMESPACE { +Index: CMakeLists.txt +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt (revision 9ce74395ceab83fe55a4ae8ee8a6b8020e832542) ++++ b/CMakeLists.txt (date 1721481973176) +@@ -14,7 +14,7 @@ + + find_package(Vulkan 1.3.256 REQUIRED) + find_package(VulkanMemoryAllocator CONFIG REQUIRED) +-find_package(VulkanMemoryAllocator-Hpp CONFIG REQUIRED) ++find_package(unofficial-vulkan-memory-allocator-hpp CONFIG REQUIRED) + + # ---------------- + # Module configurations for the external dependencies. +@@ -50,7 +50,7 @@ + target_link_libraries(VulkanMemoryAllocator-Hpp_module PUBLIC + Vulkan::Vulkan + GPUOpen::VulkanMemoryAllocator +- VulkanMemoryAllocator-Hpp::VulkanMemoryAllocator-Hpp ++ unofficial::VulkanMemoryAllocator-Hpp::VulkanMemoryAllocator-Hpp + ) + + add_library(VulkanMemoryAllocator-Hpp::module ALIAS VulkanMemoryAllocator-Hpp_module) diff --git a/overlays/vku/vcpkg.json b/overlays/vku/vcpkg.json new file mode 100644 index 0000000..e4e0277 --- /dev/null +++ b/overlays/vku/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "vku", + "version": "0.1.0", + "homepage": "https://github.com/stripe2933/vku", + "description": "Vulkan simplifications.", + "license": "MIT", + "dependencies": [ + { + "name" : "vcpkg-cmake", + "host" : true + }, + { + "name" : "vcpkg-cmake-config", + "host" : true + }, + "vulkan-memory-allocator-hpp" + ] +} \ No newline at end of file diff --git a/vcpkg.json b/vcpkg.json index 7fba94c..aa3d6ed 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,6 +2,6 @@ "dependencies": [ "glfw3", "glm", - "vulkan-memory-allocator-hpp" + "vku" ] } From ab903f3a396b254318a849e53753b4ce216b5126 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 00:18:08 +0900 Subject: [PATCH 22/37] WIP: Use vku with vcpkg overlays. --- .github/workflows/linux.yml | 5 +++++ .github/workflows/windows.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5a7ced7..3064f02 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -47,5 +47,10 @@ jobs: -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" + - name: Print log file if previous step failed + if: ${{ failure() }} + run: | + cat "/usr/local/share/vcpkg/buildtrees/vku/config-x64-linux-out.log" + - name: Build run: cmake --build build --config release \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7af91f0..70476f9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -44,5 +44,10 @@ jobs: -DCMAKE_BUILD_TYPE=Release ` -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" + - name: Print log file if previous step failed + if: ${{ failure() }} + run: | + Get-Content "C:\vcpkg\buildtrees\vku\install-x64-windows-dbg-out.log" + - name: Build run: cmake --build build --config release \ No newline at end of file From 67279d5089895052cbfc5cc8c01d544fe5a2336c Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 00:59:56 +0900 Subject: [PATCH 23/37] WIP: Use vku with vcpkg overlays. --- overlays/vku/portfile.cmake | 6 ++++-- overlays/vku/vcpkg-deps.patch | 35 ++++++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/overlays/vku/portfile.cmake b/overlays/vku/portfile.cmake index d4d2b30..c174158 100644 --- a/overlays/vku/portfile.cmake +++ b/overlays/vku/portfile.cmake @@ -1,8 +1,10 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stripe2933/vku - REF v0.1.0-test5 - SHA512 e4aa0b0195886dca6ae5a718ab68e1901b014bd430e31dae166fd7ca1308b1eebc041d0b8a261e9aee993e16ee91ac7b1c15910a9cfbfafc179191dfbbbf67a0 + REF v0.1.0-test6 + SHA512 ba33717bf7c9329163dd99174ee98adf22682518cea28c091a68147fa3ea7e8fe24a32a26bb190aa03525ff4077535f249461a1b5d78164ae1d1fd0d4f667a3a HEAD_REF module PATCHES vcpkg-deps.patch ) diff --git a/overlays/vku/vcpkg-deps.patch b/overlays/vku/vcpkg-deps.patch index 500f00c..984cc3f 100644 --- a/overlays/vku/vcpkg-deps.patch +++ b/overlays/vku/vcpkg-deps.patch @@ -6,34 +6,51 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/extlibs/module-ports/vk_mem_alloc.cppm b/extlibs/module-ports/vk_mem_alloc.cppm ---- a/extlibs/module-ports/vk_mem_alloc.cppm (revision 9ce74395ceab83fe55a4ae8ee8a6b8020e832542) -+++ b/extlibs/module-ports/vk_mem_alloc.cppm (date 1721481973172) +--- a/extlibs/module-ports/vk_mem_alloc.cppm (revision 0e4f227c492f9f612e6c7e3ebb1bba70d34622c6) ++++ b/extlibs/module-ports/vk_mem_alloc.cppm (date 1721577111225) @@ -1,6 +1,6 @@ module; #define VMA_IMPLEMENTATION -#include +#include export module vk_mem_alloc_hpp; - + export namespace VMA_HPP_NAMESPACE { +Index: cmake/config.cmake.in +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in +--- a/cmake/config.cmake.in (revision 0e4f227c492f9f612e6c7e3ebb1bba70d34622c6) ++++ b/cmake/config.cmake.in (date 1721577186572) +@@ -4,6 +4,6 @@ + + include(CMakeFindDependencyMacro) + find_dependency(Vulkan 1.3.256) +-find_dependency(VulkanMemoryAllocator-Hpp) ++find_dependency(unofficial-vulkan-memory-allocator-hpp) + + check_required_components(@PROJECT_NAME@) +\ No newline at end of file Index: CMakeLists.txt IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt (revision 9ce74395ceab83fe55a4ae8ee8a6b8020e832542) -+++ b/CMakeLists.txt (date 1721481973176) -@@ -14,7 +14,7 @@ - +--- a/CMakeLists.txt (revision 0e4f227c492f9f612e6c7e3ebb1bba70d34622c6) ++++ b/CMakeLists.txt (date 1721577111233) +@@ -28,7 +28,7 @@ + find_package(Vulkan 1.3.256 REQUIRED) find_package(VulkanMemoryAllocator CONFIG REQUIRED) -find_package(VulkanMemoryAllocator-Hpp CONFIG REQUIRED) +find_package(unofficial-vulkan-memory-allocator-hpp CONFIG REQUIRED) - + # ---------------- # Module configurations for the external dependencies. -@@ -50,7 +50,7 @@ +@@ -63,7 +63,7 @@ target_link_libraries(VulkanMemoryAllocator-Hpp_module PUBLIC Vulkan::Vulkan GPUOpen::VulkanMemoryAllocator From d6a79effd431b4c30ce6073a439614fc0c78ae7f Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 01:36:02 +0900 Subject: [PATCH 24/37] WIP: Use vku with vcpkg overlays. --- overlays/vku/portfile.cmake | 4 ++-- overlays/vku/vcpkg-deps.patch | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/overlays/vku/portfile.cmake b/overlays/vku/portfile.cmake index c174158..340b380 100644 --- a/overlays/vku/portfile.cmake +++ b/overlays/vku/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stripe2933/vku - REF v0.1.0-test6 - SHA512 ba33717bf7c9329163dd99174ee98adf22682518cea28c091a68147fa3ea7e8fe24a32a26bb190aa03525ff4077535f249461a1b5d78164ae1d1fd0d4f667a3a + REF v0.1.0-test7 + SHA512 c17bc05f87b89e6a48e1558f8c2d0d7738d7f17221a5e78c9f4523b2b433ae26dff51136276aa421b56804f749741e03f4210e375f413139fd7ee5e33bb70d9e HEAD_REF module PATCHES vcpkg-deps.patch ) diff --git a/overlays/vku/vcpkg-deps.patch b/overlays/vku/vcpkg-deps.patch index 984cc3f..aa305d2 100644 --- a/overlays/vku/vcpkg-deps.patch +++ b/overlays/vku/vcpkg-deps.patch @@ -6,15 +6,15 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/extlibs/module-ports/vk_mem_alloc.cppm b/extlibs/module-ports/vk_mem_alloc.cppm ---- a/extlibs/module-ports/vk_mem_alloc.cppm (revision 0e4f227c492f9f612e6c7e3ebb1bba70d34622c6) -+++ b/extlibs/module-ports/vk_mem_alloc.cppm (date 1721577111225) +--- a/extlibs/module-ports/vk_mem_alloc.cppm (revision 9c77f0d2cef4ee98c7946cd11e2e7f9ad4068ebb) ++++ b/extlibs/module-ports/vk_mem_alloc.cppm (date 1721578039193) @@ -1,6 +1,6 @@ module; #define VMA_IMPLEMENTATION -#include +#include export module vk_mem_alloc_hpp; - + export namespace VMA_HPP_NAMESPACE { Index: cmake/config.cmake.in IDEA additional info: @@ -22,15 +22,15 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in ---- a/cmake/config.cmake.in (revision 0e4f227c492f9f612e6c7e3ebb1bba70d34622c6) -+++ b/cmake/config.cmake.in (date 1721577186572) +--- a/cmake/config.cmake.in (revision 9c77f0d2cef4ee98c7946cd11e2e7f9ad4068ebb) ++++ b/cmake/config.cmake.in (date 1721578039190) @@ -4,6 +4,6 @@ - + include(CMakeFindDependencyMacro) find_dependency(Vulkan 1.3.256) -find_dependency(VulkanMemoryAllocator-Hpp) +find_dependency(unofficial-vulkan-memory-allocator-hpp) - + check_required_components(@PROJECT_NAME@) \ No newline at end of file Index: CMakeLists.txt @@ -39,15 +39,15 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt (revision 0e4f227c492f9f612e6c7e3ebb1bba70d34622c6) -+++ b/CMakeLists.txt (date 1721577111233) +--- a/CMakeLists.txt (revision 9c77f0d2cef4ee98c7946cd11e2e7f9ad4068ebb) ++++ b/CMakeLists.txt (date 1721578039198) @@ -28,7 +28,7 @@ - + find_package(Vulkan 1.3.256 REQUIRED) find_package(VulkanMemoryAllocator CONFIG REQUIRED) -find_package(VulkanMemoryAllocator-Hpp CONFIG REQUIRED) +find_package(unofficial-vulkan-memory-allocator-hpp CONFIG REQUIRED) - + # ---------------- # Module configurations for the external dependencies. @@ -63,7 +63,7 @@ From 96bed34baa3bd2969a0ebc2fd3b4b98f69a8f0d4 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 01:45:46 +0900 Subject: [PATCH 25/37] WIP: Use vku with vcpkg overlays. --- .github/workflows/linux.yml | 1 + .github/workflows/x64-linux-clang.cmake | 2 ++ overlays/vku/vcpkg.json | 1 + 3 files changed, 4 insertions(+) create mode 100644 .github/workflows/x64-linux-clang.cmake diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 3064f02..624d195 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -44,6 +44,7 @@ jobs: -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ + -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=".github/workflows/x64-linux-clang.cmake" \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" diff --git a/.github/workflows/x64-linux-clang.cmake b/.github/workflows/x64-linux-clang.cmake new file mode 100644 index 0000000..b620b9e --- /dev/null +++ b/.github/workflows/x64-linux-clang.cmake @@ -0,0 +1,2 @@ +set(CMAKE_C_COMPILER /usr/bin/clang-18) +set(CMAKE_CXX_COMPILER /usr/bin/clang++-18) \ No newline at end of file diff --git a/overlays/vku/vcpkg.json b/overlays/vku/vcpkg.json index e4e0277..1620774 100644 --- a/overlays/vku/vcpkg.json +++ b/overlays/vku/vcpkg.json @@ -13,6 +13,7 @@ "name" : "vcpkg-cmake-config", "host" : true }, + "vulkan-memory-allocator", "vulkan-memory-allocator-hpp" ] } \ No newline at end of file From 964fcde4eb8b2706131c941c27e8cc27d60d08ba Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 01:56:24 +0900 Subject: [PATCH 26/37] WIP: Use vku with vcpkg overlays. --- overlays/vku/portfile.cmake | 4 ++-- overlays/vku/vcpkg-deps.patch | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/overlays/vku/portfile.cmake b/overlays/vku/portfile.cmake index 340b380..9a1a316 100644 --- a/overlays/vku/portfile.cmake +++ b/overlays/vku/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stripe2933/vku - REF v0.1.0-test7 - SHA512 c17bc05f87b89e6a48e1558f8c2d0d7738d7f17221a5e78c9f4523b2b433ae26dff51136276aa421b56804f749741e03f4210e375f413139fd7ee5e33bb70d9e + REF v0.1.0-test8 + SHA512 c832e3779215f55240df0f868bfb1513d9d4e4d4434c6610607517b251e251f6a13325e3e447c7c73628e79767f93401a2ced09fc473a464577599fac519a272 HEAD_REF module PATCHES vcpkg-deps.patch ) diff --git a/overlays/vku/vcpkg-deps.patch b/overlays/vku/vcpkg-deps.patch index aa305d2..8a77611 100644 --- a/overlays/vku/vcpkg-deps.patch +++ b/overlays/vku/vcpkg-deps.patch @@ -6,8 +6,8 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/extlibs/module-ports/vk_mem_alloc.cppm b/extlibs/module-ports/vk_mem_alloc.cppm ---- a/extlibs/module-ports/vk_mem_alloc.cppm (revision 9c77f0d2cef4ee98c7946cd11e2e7f9ad4068ebb) -+++ b/extlibs/module-ports/vk_mem_alloc.cppm (date 1721578039193) +--- a/extlibs/module-ports/vk_mem_alloc.cppm (revision b857b0b68629b4e2c34b60a4a0b1692807918ce0) ++++ b/extlibs/module-ports/vk_mem_alloc.cppm (date 1721580719051) @@ -1,6 +1,6 @@ module; #define VMA_IMPLEMENTATION @@ -22,12 +22,12 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in ---- a/cmake/config.cmake.in (revision 9c77f0d2cef4ee98c7946cd11e2e7f9ad4068ebb) -+++ b/cmake/config.cmake.in (date 1721578039190) -@@ -4,6 +4,6 @@ - +--- a/cmake/config.cmake.in (revision b857b0b68629b4e2c34b60a4a0b1692807918ce0) ++++ b/cmake/config.cmake.in (date 1721580719048) +@@ -5,6 +5,6 @@ include(CMakeFindDependencyMacro) find_dependency(Vulkan 1.3.256) + find_dependency(VulkanMemoryAllocator) -find_dependency(VulkanMemoryAllocator-Hpp) +find_dependency(unofficial-vulkan-memory-allocator-hpp) @@ -39,8 +39,8 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt (revision 9c77f0d2cef4ee98c7946cd11e2e7f9ad4068ebb) -+++ b/CMakeLists.txt (date 1721578039198) +--- a/CMakeLists.txt (revision b857b0b68629b4e2c34b60a4a0b1692807918ce0) ++++ b/CMakeLists.txt (date 1721580719055) @@ -28,7 +28,7 @@ find_package(Vulkan 1.3.256 REQUIRED) From 64d3cbaffb87d98779bb3cc1d5373852388aee5e Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 02:08:23 +0900 Subject: [PATCH 27/37] WIP: Use vku with vcpkg overlays. --- .github/workflows/linux.yml | 4 +++- .github/workflows/triplets/clang-toolchain.cmake | 2 ++ .github/workflows/x64-linux-clang.cmake | 7 +++++-- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/triplets/clang-toolchain.cmake diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 624d195..3801e78 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -44,7 +44,9 @@ jobs: -DCMAKE_CXX_COMPILER="/usr/bin/clang++-18" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ - -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=".github/workflows/x64-linux-clang.cmake" \ + -DVCPKG_OVERLAY_TRIPLETS=".github/workflows/triplets" \ + -DVCPKG_TARGET_TRIPLET="x64-linux-clang" \ + -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=".github/workflows/triplets/clang-toolchain.cmake" \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" diff --git a/.github/workflows/triplets/clang-toolchain.cmake b/.github/workflows/triplets/clang-toolchain.cmake new file mode 100644 index 0000000..b620b9e --- /dev/null +++ b/.github/workflows/triplets/clang-toolchain.cmake @@ -0,0 +1,2 @@ +set(CMAKE_C_COMPILER /usr/bin/clang-18) +set(CMAKE_CXX_COMPILER /usr/bin/clang++-18) \ No newline at end of file diff --git a/.github/workflows/x64-linux-clang.cmake b/.github/workflows/x64-linux-clang.cmake index b620b9e..e65f6a6 100644 --- a/.github/workflows/x64-linux-clang.cmake +++ b/.github/workflows/x64-linux-clang.cmake @@ -1,2 +1,5 @@ -set(CMAKE_C_COMPILER /usr/bin/clang-18) -set(CMAKE_CXX_COMPILER /usr/bin/clang++-18) \ No newline at end of file +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE static) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME Linux) +set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE .github/workflows/triplets/clang-toolchain.cmake) \ No newline at end of file From ba7bbaa2e96b9c3c2d1c459bc922c0829bf5e7fc Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 02:12:06 +0900 Subject: [PATCH 28/37] WIP: Use vku with vcpkg overlays. --- .github/workflows/{triplets => }/clang-toolchain.cmake | 0 .github/workflows/linux.yml | 2 +- .github/workflows/{ => triplets}/x64-linux-clang.cmake | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{triplets => }/clang-toolchain.cmake (100%) rename .github/workflows/{ => triplets}/x64-linux-clang.cmake (61%) diff --git a/.github/workflows/triplets/clang-toolchain.cmake b/.github/workflows/clang-toolchain.cmake similarity index 100% rename from .github/workflows/triplets/clang-toolchain.cmake rename to .github/workflows/clang-toolchain.cmake diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 3801e78..19a8d36 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -46,7 +46,7 @@ jobs: -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ -DVCPKG_OVERLAY_TRIPLETS=".github/workflows/triplets" \ -DVCPKG_TARGET_TRIPLET="x64-linux-clang" \ - -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=".github/workflows/triplets/clang-toolchain.cmake" \ + -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=".github/workflows/clang-toolchain.cmake" \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" diff --git a/.github/workflows/x64-linux-clang.cmake b/.github/workflows/triplets/x64-linux-clang.cmake similarity index 61% rename from .github/workflows/x64-linux-clang.cmake rename to .github/workflows/triplets/x64-linux-clang.cmake index e65f6a6..3aa57b1 100644 --- a/.github/workflows/x64-linux-clang.cmake +++ b/.github/workflows/triplets/x64-linux-clang.cmake @@ -2,4 +2,4 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME Linux) -set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE .github/workflows/triplets/clang-toolchain.cmake) \ No newline at end of file +set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE .github/workflows/clang-toolchain.cmake) \ No newline at end of file From 48722e132104746fde50749f7429bbab4b4bf327 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 02:17:35 +0900 Subject: [PATCH 29/37] WIP: Use vku with vcpkg overlays. --- .github/workflows/clang-toolchain.cmake | 2 -- .github/workflows/linux.yml | 1 - .github/workflows/triplets/x64-linux-clang.cmake | 4 +++- 3 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 .github/workflows/clang-toolchain.cmake diff --git a/.github/workflows/clang-toolchain.cmake b/.github/workflows/clang-toolchain.cmake deleted file mode 100644 index b620b9e..0000000 --- a/.github/workflows/clang-toolchain.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(CMAKE_C_COMPILER /usr/bin/clang-18) -set(CMAKE_CXX_COMPILER /usr/bin/clang++-18) \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 19a8d36..73eefd9 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -46,7 +46,6 @@ jobs: -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ -DVCPKG_OVERLAY_TRIPLETS=".github/workflows/triplets" \ -DVCPKG_TARGET_TRIPLET="x64-linux-clang" \ - -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=".github/workflows/clang-toolchain.cmake" \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" diff --git a/.github/workflows/triplets/x64-linux-clang.cmake b/.github/workflows/triplets/x64-linux-clang.cmake index 3aa57b1..050b498 100644 --- a/.github/workflows/triplets/x64-linux-clang.cmake +++ b/.github/workflows/triplets/x64-linux-clang.cmake @@ -2,4 +2,6 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME Linux) -set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE .github/workflows/clang-toolchain.cmake) \ No newline at end of file + +set(CMAKE_C_COMPILER /usr/bin/clang-18) +set(CMAKE_CXX_COMPILER /usr/bin/clang++-18) \ No newline at end of file From c0590a1d869eace1ab7af963db9e65a28722ad61 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 02:20:03 +0900 Subject: [PATCH 30/37] WIP: Use vku with vcpkg overlays. --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 73eefd9..8b289ff 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -52,7 +52,7 @@ jobs: - name: Print log file if previous step failed if: ${{ failure() }} run: | - cat "/usr/local/share/vcpkg/buildtrees/vku/config-x64-linux-out.log" + cat "/usr/local/share/vcpkg/buildtrees/vku/config-x64-linux-clang-out.log" - name: Build run: cmake --build build --config release \ No newline at end of file From 8bce4b46512e5f89db42477a3674ef9ae055912f Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 02:25:25 +0900 Subject: [PATCH 31/37] WIP: Use vku with vcpkg overlays. --- .github/workflows/clang-toolchain.cmake | 2 ++ .github/workflows/triplets/x64-linux-clang.cmake | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/clang-toolchain.cmake diff --git a/.github/workflows/clang-toolchain.cmake b/.github/workflows/clang-toolchain.cmake new file mode 100644 index 0000000..b620b9e --- /dev/null +++ b/.github/workflows/clang-toolchain.cmake @@ -0,0 +1,2 @@ +set(CMAKE_C_COMPILER /usr/bin/clang-18) +set(CMAKE_CXX_COMPILER /usr/bin/clang++-18) \ No newline at end of file diff --git a/.github/workflows/triplets/x64-linux-clang.cmake b/.github/workflows/triplets/x64-linux-clang.cmake index 050b498..e296266 100644 --- a/.github/workflows/triplets/x64-linux-clang.cmake +++ b/.github/workflows/triplets/x64-linux-clang.cmake @@ -3,5 +3,4 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME Linux) -set(CMAKE_C_COMPILER /usr/bin/clang-18) -set(CMAKE_CXX_COMPILER /usr/bin/clang++-18) \ No newline at end of file +set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/clang-toolchain.cmake) \ No newline at end of file From 4c91719c3bf1a0ab2056e653495cf66643c00aa6 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 02:30:50 +0900 Subject: [PATCH 32/37] WIP: Use vku with vcpkg overlays. --- .github/workflows/linux.yml | 1 + .github/workflows/triplets/x64-linux-clang.cmake | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8b289ff..25fa345 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -46,6 +46,7 @@ jobs: -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ -DVCPKG_OVERLAY_TRIPLETS=".github/workflows/triplets" \ -DVCPKG_TARGET_TRIPLET="x64-linux-clang" \ + -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=".github/workflows/clang-toolchain.cmake" \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" diff --git a/.github/workflows/triplets/x64-linux-clang.cmake b/.github/workflows/triplets/x64-linux-clang.cmake index e296266..216af27 100644 --- a/.github/workflows/triplets/x64-linux-clang.cmake +++ b/.github/workflows/triplets/x64-linux-clang.cmake @@ -1,6 +1,4 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_CMAKE_SYSTEM_NAME Linux) - -set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/clang-toolchain.cmake) \ No newline at end of file +set(VCPKG_CMAKE_SYSTEM_NAME Linux) \ No newline at end of file From 18fb20309359a2f3df99a1c7a9ba163f566774e3 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 02:38:15 +0900 Subject: [PATCH 33/37] WIP: Use vku with vcpkg overlays. --- .github/workflows/linux.yml | 2 +- .github/workflows/triplets/x64-linux-clang.cmake | 3 ++- .github/workflows/windows.yml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 25fa345..4efd938 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -10,7 +10,7 @@ on: - '!README.md' - '!LICENSE.txt' - '!doc/**' - - '!.github/workflows/**' + - '!.github/workflows/*.yml' - '.github/workflows/linux.yml' jobs: diff --git a/.github/workflows/triplets/x64-linux-clang.cmake b/.github/workflows/triplets/x64-linux-clang.cmake index 216af27..60d42b6 100644 --- a/.github/workflows/triplets/x64-linux-clang.cmake +++ b/.github/workflows/triplets/x64-linux-clang.cmake @@ -1,4 +1,5 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_CMAKE_SYSTEM_NAME Linux) \ No newline at end of file +set(VCPKG_CMAKE_SYSTEM_NAME Linux) +set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/../clang-toolchain.cmake) \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 70476f9..e59b1d6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,7 +10,7 @@ on: - '!README.md' - '!LICENSE.txt' - '!doc/**' - - '!.github/workflows/**' + - '!.github/workflows/*.yml' - '.github/workflows/windows.yml' jobs: From c596ca54691cb31ffb0622ff51f8e1006f62604a Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 02:42:52 +0900 Subject: [PATCH 34/37] WIP: Use vku with vcpkg overlays. --- .github/workflows/linux.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4efd938..ef00c6c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -46,7 +46,6 @@ jobs: -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ -DVCPKG_OVERLAY_TRIPLETS=".github/workflows/triplets" \ -DVCPKG_TARGET_TRIPLET="x64-linux-clang" \ - -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=".github/workflows/clang-toolchain.cmake" \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" From 0540dbf5d93c43dd56aa29e718335182493744ac Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 02:45:47 +0900 Subject: [PATCH 35/37] WIP: Use vku with vcpkg overlays. --- .github/workflows/clang-toolchain.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang-toolchain.cmake b/.github/workflows/clang-toolchain.cmake index b620b9e..c4fb69d 100644 --- a/.github/workflows/clang-toolchain.cmake +++ b/.github/workflows/clang-toolchain.cmake @@ -1,2 +1,4 @@ set(CMAKE_C_COMPILER /usr/bin/clang-18) -set(CMAKE_CXX_COMPILER /usr/bin/clang++-18) \ No newline at end of file +set(CMAKE_CXX_COMPILER /usr/bin/clang++-18) +set(CMAKE_CXX_FLAGS "-stdlib=libc++") +set(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++ -lc++abi") \ No newline at end of file From 7f90b3aa566923eedc7668628c2367b1fba2ddc6 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 03:06:33 +0900 Subject: [PATCH 36/37] Remove log printing. --- .github/workflows/linux.yml | 5 ----- .github/workflows/windows.yml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ef00c6c..0f905fe 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -49,10 +49,5 @@ jobs: -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" - - name: Print log file if previous step failed - if: ${{ failure() }} - run: | - cat "/usr/local/share/vcpkg/buildtrees/vku/config-x64-linux-clang-out.log" - - name: Build run: cmake --build build --config release \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e59b1d6..258d8d8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -44,10 +44,5 @@ jobs: -DCMAKE_BUILD_TYPE=Release ` -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" - - name: Print log file if previous step failed - if: ${{ failure() }} - run: | - Get-Content "C:\vcpkg\buildtrees\vku\install-x64-windows-dbg-out.log" - - name: Build run: cmake --build build --config release \ No newline at end of file From a859990fb71c749ecd17bad63af8f2e1dc57fb97 Mon Sep 17 00:00:00 2001 From: gomkyung2 Date: Mon, 22 Jul 2024 03:14:17 +0900 Subject: [PATCH 37/37] Update CI. --- README.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ad53ca5..d1284cc 100644 --- a/README.md +++ b/README.md @@ -28,17 +28,41 @@ This project depends on: ### Build Steps -To install `vku`, refer to the repository's [README](https://github.com/stripe2933/vku/tree/module/README.md) and follow the instructions. +### 1. Using vcpkg + +> [!TIP] +> This project uses GitHub Runner to ensure build compatibility on both Linux and Windows, with dependency management handled by vcpkg. You can check the workflow files in the [.github/workflows](.github/workflows) folder. + +This project, along with its dependency `vku`, supports vcpkg for dependency management. Follow these steps to build the project: ```sh git clone https://github.com/stripe2933/vk-deferred cd vk-deferred -cmake --preset=default # Or use your own CMakeUserPresets.json to override the configuration settings. +cmake --preset=vcpkg # Or use your own configuration preset that inherits from the "vcpkg" preset. cmake --build build -t vk-deferred ``` The executable will be located in the build folder. +### 2. Manual Dependency Setup + +If your system already has the required dependencies installed, and the following CMake commands are available: + +```cmake +find_package(VulkanMemoryAllocator REQUIRED) +find_package(VulkanMemoryAllocator-Hpp REQUIRED) +find_package(vku REQUIRED) +``` + +You can build the project with these commands: + +```sh +git clone https://github.com/stripe2933/vk-deferred +cd vk-deferred +cmake --preset=default +cmake --build build -t vk-deferred +``` + ### Shader compilation All shaders are located in the [shaders](/shaders) folder and need to be manually compiled into `.spv` before the application launch. To make this easier, script files are available for you: