Skip to content

Commit e1c31d7

Browse files
committed
Remove Vulkan dependency, adjust CI workflow for optional module builds, and streamline dependency installation
- Removed Vulkan as a dependency from `vcpkg.json`. - Updated CI to support conditional builds with and without C++20 modules. - Introduced Clang and Ninja for module-enabled builds on Ubuntu. - Added Vulkan SDK installation for Windows CI.
1 parent 84400ff commit e1c31d7

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.github/workflows/simple_engine.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ jobs:
6060
sudo apt-get install -y \
6161
build-essential \
6262
cmake \
63+
ninja-build \
64+
clang \
6365
libglfw3-dev \
6466
libglm-dev \
6567
libxrandr-dev \
@@ -98,14 +100,39 @@ jobs:
98100
run: |
99101
if exist install_dependencies_windows.bat call install_dependencies_windows.bat || exit /b 0
100102
103+
# Install LunarG Vulkan SDK on Windows and export environment variables for our FindVulkan.cmake
104+
- name: Install Vulkan SDK (Windows)
105+
if: matrix.os == 'windows-latest'
106+
shell: pwsh
107+
run: |
108+
choco install vulkan-sdk -y --no-progress
109+
$sdkDir = Get-ChildItem -Path 'C:\VulkanSDK' -ErrorAction SilentlyContinue | Sort-Object Name -Descending | Select-Object -First 1
110+
if (-not $sdkDir) { throw "Vulkan SDK was not installed to C:\VulkanSDK" }
111+
echo "Using Vulkan SDK: $($sdkDir.FullName)"
112+
echo "VULKAN_SDK=$($sdkDir.FullName)" >> $env:GITHUB_ENV
113+
echo "PATH=$($sdkDir.FullName)\Bin;$env:PATH" >> $env:GITHUB_ENV
114+
101115
# -----------------------
102116
# Configure & Build
103117
# -----------------------
104-
- name: Configure (Unix)
105-
if: matrix.os == 'ubuntu-latest'
118+
# Configure on Ubuntu without modules: GCC + Unix Makefiles
119+
- name: "Configure (Ubuntu • non-module: GCC + Makefiles)"
120+
if: matrix.os == 'ubuntu-latest' && matrix.enable_module == 'OFF'
121+
run: |
122+
cmake -S attachments/simple_engine \
123+
-B build-simple_engine-${{ matrix.os }}-${{ matrix.build_type }}-m${{ matrix.enable_module }} \
124+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
125+
-DENABLE_CPP20_MODULE=${{ matrix.enable_module }}
126+
127+
# Configure on Ubuntu with modules enabled: use Clang + Ninja (required for C++ modules)
128+
- name: "Configure (Ubuntu • module: Clang + Ninja)"
129+
if: matrix.os == 'ubuntu-latest' && matrix.enable_module == 'ON'
106130
run: |
107131
cmake -S attachments/simple_engine \
108132
-B build-simple_engine-${{ matrix.os }}-${{ matrix.build_type }}-m${{ matrix.enable_module }} \
133+
-G Ninja \
134+
-DCMAKE_C_COMPILER=clang \
135+
-DCMAKE_CXX_COMPILER=clang++ \
109136
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
110137
-DENABLE_CPP20_MODULE=${{ matrix.enable_module }}
111138

attachments/simple_engine/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
cmake_minimum_required(VERSION 3.29)
22

3-
# Enable C++ module dependency scanning
4-
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
5-
63
project(SimpleEngine VERSION 1.0.0 LANGUAGES CXX C)
74

85
# Option to enable/disable Vulkan C++20 module support for this standalone project

vcpkg.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"tinygltf",
1010
"nlohmann-json",
1111
"ktx",
12-
"openal-soft",
13-
"vulkan"
12+
"openal-soft"
1413
]
1514
}

0 commit comments

Comments
 (0)