From 5fe9c04d4a96d237e203a3b65c9ce1678be9658d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Meslin?= Date: Sat, 20 Jun 2026 15:20:19 +0200 Subject: [PATCH 1/5] Add GitHub Actions CI workflows Two builds on each push/tag: Linux via a Docker container (Ubuntu 24.04, Qt6, Ninja) and Windows via MSVC 2022 / Qt 6.8 with windeployqt6. A release job uploads both archives when a version tag is pushed. Adds waller.pro MSVC flag conditionals (/W4 /arch:SSE4.1 /MP) so the project compiles with both MSVC and GCC/Clang from the same .pro file. --- .github/docker/Dockerfile | 11 ++++ .github/workflows/ci.yml | 102 ++++++++++++++++++++++++++++++++++++++ editor/waller.pro | 12 +++-- 3 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 .github/docker/Dockerfile create mode 100644 .github/workflows/ci.yml diff --git a/.github/docker/Dockerfile b/.github/docker/Dockerfile new file mode 100644 index 0000000..10160a5 --- /dev/null +++ b/.github/docker/Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu:24.04 + +RUN apt-get update && apt-get install -y \ + ninja-build \ + g++ \ + git \ + qt6-base-dev \ + qt6-tools-dev \ + qt6-tools-dev-tools \ + qt6-multimedia-dev \ + && rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c9dfa8f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,102 @@ +name: CI + +on: + push: + branches: [main] + tags: ['v*'] + pull_request: + branches: [main] + +jobs: + build-linux: + runs-on: ubuntu-latest + container: + image: ghcr.io/marzac/die-ci:latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4.2.2 + + - name: Build + run: | + cmake -B build -S editor -DCMAKE_BUILD_TYPE=Release -G Ninja + cmake --build build --parallel + + - name: Package + run: | + mkdir -p staging + cp build/waller staging/ + cp README.md MANUAL.md LICENSE staging/ + [ -d maps ] && cp -r maps staging/ + tar -czf waller-linux.tar.gz -C staging . + + - name: Upload tarball + uses: actions/upload-artifact@v4.6.2 + with: + name: waller-ubuntu + path: waller-linux.tar.gz + + build-windows: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4.2.2 + + - name: Install Qt6 + uses: jurplel/install-qt-action@v4 + with: + version: '6.8.*' + arch: win64_msvc2022_64 + modules: 'qtmultimedia' + cache: true + + - name: Build + run: | + cmake -B build -S editor -DCMAKE_BUILD_TYPE=Release + cmake --build build --config Release --parallel + + - name: Deploy + run: | + mkdir deploy + copy build\Release\waller.exe deploy\ + windeployqt6 --no-quick-import --release --no-system-d3d-compiler --no-system-dxc-compiler --no-compiler-runtime --no-opengl-sw --no-translations deploy\waller.exe + copy README.md deploy\ + copy MANUAL.md deploy\ + copy LICENSE deploy\ + if (Test-Path maps) { Copy-Item -Recurse maps deploy\ } + + - name: Package + run: Compress-Archive -Path deploy\* -DestinationPath waller-windows.zip + + - name: Upload ZIP + uses: actions/upload-artifact@v4.6.2 + with: + name: waller-windows + path: waller-windows.zip + + release: + needs: [build-linux, build-windows] + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + permissions: + contents: write + + steps: + - name: Download tarball + uses: actions/download-artifact@v4.2.1 + with: + name: waller-ubuntu + path: artifacts/ + + - name: Download ZIP + uses: actions/download-artifact@v4.2.1 + with: + name: waller-windows + path: artifacts/ + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + files: artifacts/* diff --git a/editor/waller.pro b/editor/waller.pro index c05d58d..bd11ad2 100644 --- a/editor/waller.pro +++ b/editor/waller.pro @@ -3,9 +3,15 @@ QT += core gui spatialaudio greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++17 -QMAKE_CXXFLAGS_RELEASE *= -O2 -QMAKE_LFLAGS_RELEASE *= -s -QMAKE_CXXFLAGS += -msse4 -save-temps -Wall -Wextra + +win32-msvc* { + QMAKE_CXXFLAGS_RELEASE *= /O2 + QMAKE_CXXFLAGS += /W4 /arch:SSE4.1 /MP +} else { + QMAKE_CXXFLAGS_RELEASE *= -O2 + QMAKE_LFLAGS_RELEASE *= -s + QMAKE_CXXFLAGS += -msse4 -save-temps -Wall -Wextra +} #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 From 24d80750ad0541861d1997247ce5243c4fc5c886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Meslin?= Date: Sat, 20 Jun 2026 15:22:16 +0200 Subject: [PATCH 2/5] Convert build system from qmake to CMake Add editor/CMakeLists.txt alongside waller.pro (both remain usable). CMake handles AUTOMOC/AUTOUIC/AUTORCC, links Qt6 SpatialAudio, and applies the same MSVC / GCC-Clang flag split as the updated .pro file. The editor source directory is added explicitly to the include search path to match qmake's implicit behaviour and satisfy AUTOMOC. CI configure steps updated to cmake -B build -S editor. --- editor/CMakeLists.txt | 67 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 editor/CMakeLists.txt diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt new file mode 100644 index 0000000..7b11aa2 --- /dev/null +++ b/editor/CMakeLists.txt @@ -0,0 +1,67 @@ +cmake_minimum_required(VERSION 3.16) +project(waller LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets SpatialAudio) + +set(SOURCES + main.cpp + editor.cpp + walker.cpp + mainwindow.cpp + renderwindow.cpp + wdgmapeditor.cpp + wdgmapview.cpp + wdgtexselector.cpp + wdgtexview.cpp + ../common/engine/renderer.cpp + ../common/engine/renderer_config.cpp + ../common/engine/audio.cpp + ../common/engine/map.cpp + ../common/engine/map_io.cpp + ../common/engine/tags.cpp + ../common/engine/env.cpp + ../common/engine/workerpool.cpp + ../common/engine/gamepad.cpp + mainwindow.ui + renderwindow.ui + resources.qrc +) + +if(WIN32) + list(APPEND SOURCES editor.rc) +endif() + +qt_add_executable(waller WIN32 ${SOURCES}) + +target_include_directories(waller PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ../common/engine + ../common/game +) + +target_link_libraries(waller PRIVATE + Qt6::Core + Qt6::Gui + Qt6::Widgets + Qt6::SpatialAudio +) + +if(WIN32) + target_link_libraries(waller PRIVATE xinput winmm ws2_32) +endif() + +if(MSVC) + target_compile_options(waller PRIVATE /W4 /arch:SSE4.1 /MP) + target_compile_options(waller PRIVATE $<$:/O2>) +else() + target_compile_options(waller PRIVATE -msse4 -save-temps -Wall -Wextra) + target_compile_options(waller PRIVATE $<$:-O2>) + target_link_options(waller PRIVATE $<$:-s>) +endif() From 1a514b270091efdf60019b1327bd6b54fa98763c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Meslin?= Date: Sat, 20 Jun 2026 15:26:17 +0200 Subject: [PATCH 3/5] Install Linux build deps inline instead of using Docker image Avoids the chicken-and-egg problem where the CI image must exist before the first CI run. The build-ci-image.yml is kept for future use if a cached image becomes worth maintaining. --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9dfa8f..b75f11e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,15 +10,15 @@ on: jobs: build-linux: runs-on: ubuntu-latest - container: - image: ghcr.io/marzac/die-ci:latest - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v4.2.2 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y ninja-build g++ qt6-base-dev qt6-tools-dev qt6-tools-dev-tools qt6-multimedia-dev + - name: Build run: | cmake -B build -S editor -DCMAKE_BUILD_TYPE=Release -G Ninja From 38020472426b91756a1bcd396423bfa0c8397f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Meslin?= Date: Sat, 20 Jun 2026 15:32:45 +0200 Subject: [PATCH 4/5] Disable MSVC warnings-as-errors (/WX-) --- editor/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index 7b11aa2..3e7e748 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -58,7 +58,7 @@ if(WIN32) endif() if(MSVC) - target_compile_options(waller PRIVATE /W4 /arch:SSE4.1 /MP) + target_compile_options(waller PRIVATE /W4 /arch:SSE4.1 /MP /WX-) target_compile_options(waller PRIVATE $<$:/O2>) else() target_compile_options(waller PRIVATE -msse4 -save-temps -Wall -Wextra) From f387545f21aa3c5c562d2fa88001b84bc8567c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Meslin?= Date: Sat, 20 Jun 2026 15:38:32 +0200 Subject: [PATCH 5/5] Fix MSVC build: cpuid.h and /arch:SSE4.1 incompatibilities cpuid.h is GCC/Clang only; guard with _MSC_VER and use with MSVC's __cpuid(int[4], level) signature instead. /arch:SSE4.1 is not recognised on MSVC x64 (SSE4 intrinsics are always available there without a flag); remove from CMakeLists.txt and waller.pro. --- editor/CMakeLists.txt | 2 +- editor/main.cpp | 10 ++++++++++ editor/waller.pro | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index 3e7e748..a54a739 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -58,7 +58,7 @@ if(WIN32) endif() if(MSVC) - target_compile_options(waller PRIVATE /W4 /arch:SSE4.1 /MP /WX-) + target_compile_options(waller PRIVATE /W4 /MP /WX-) target_compile_options(waller PRIVATE $<$:/O2>) else() target_compile_options(waller PRIVATE -msse4 -save-temps -Wall -Wextra) diff --git a/editor/main.cpp b/editor/main.cpp index 71e453f..022a7ed 100644 --- a/editor/main.cpp +++ b/editor/main.cpp @@ -21,14 +21,24 @@ #include #include +#ifdef _MSC_VER +#include +#else #include +#endif /*****************************************************************************/ inline bool hasSSE41() { +#ifdef _MSC_VER + int cpuInfo[4]; + __cpuid(cpuInfo, 1); + return (cpuInfo[2] & (1 << 19)) != 0; // SSE4.1 is bit 19 of ECX +#else uint32_t eax, ebx, ecx, edx; __cpuid(1, eax, ebx, ecx, edx); return (ecx & (1 << 19)) != 0; // SSE4.1 is bit 19 of ECX +#endif } /*****************************************************************************/ diff --git a/editor/waller.pro b/editor/waller.pro index bd11ad2..3e112b7 100644 --- a/editor/waller.pro +++ b/editor/waller.pro @@ -6,7 +6,7 @@ CONFIG += c++17 win32-msvc* { QMAKE_CXXFLAGS_RELEASE *= /O2 - QMAKE_CXXFLAGS += /W4 /arch:SSE4.1 /MP + QMAKE_CXXFLAGS += /W4 /MP } else { QMAKE_CXXFLAGS_RELEASE *= -O2 QMAKE_LFLAGS_RELEASE *= -s