windows cmake test build (#1321)

This commit is contained in:
Turánszki János
2025-11-24 09:27:35 +01:00
committed by GitHub
parent 16a1942975
commit 40f862135b
2 changed files with 80 additions and 0 deletions
+74
View File
@@ -82,6 +82,80 @@ jobs:
Editor_Windows.exe
windows_cmake:
runs-on: windows-latest
name: windows (cmake)
env:
# needed on Windows because wiRenderer conditionally includes wiShaderDump.h
# and only our CMake config has a workaround for it
CCACHE_NODIRECT: 1
steps:
- uses: actions/checkout@v4
- name: Restore Ccache database
id: restore-ccache
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\AppData\Local\ccache
key: ccache-win-${{ github.run_id }}
restore-keys: ccache-win-
- name: Install Ccache
run: |
curl -sOSL https://github.com/ccache/ccache/releases/download/v$Env:CCACHE_VERSION/ccache-$Env:CCACHE_VERSION-windows-x86_64.zip
unzip -qj ccache-$Env:CCACHE_VERSION-windows-x86_64.zip ccache-$Env:CCACHE_VERSION-windows-x86_64/ccache.exe
mv ccache.exe cl.exe
mv .github/workflows/Directory.Build.props.ghbuild Directory.Build.props
- name: Initial compile
shell: cmd
run: |
cmake -B build -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
cmake --build build --config Release --parallel
- name: Generate shader dump
shell: cmd
run: |
mv build/WickedEngine/Release/offlineshadercompiler.exe build/WickedEngine
cd build/WickedEngine
offlineshadercompiler.exe hlsl6 spirv rebuild shaderdump strip_reflection
mv wiShaderDump.h ../../WickedEngine/
- name: Recompile with shader dump
shell: cmd
run: |
cmake -B build -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
cmake --build build --config Release --parallel
- name: Save Ccache database
id: save-ccache
if: always() && steps.restore-ccache.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: C:\Users\runneradmin\AppData\Local\ccache
key: ${{ steps.restore-ccache.outputs.cache-primary-key }}
- name: Move files
shell: cmd
run: |
move build\Editor\Release\Editor.exe .\Editor_Windows.exe
move Editor\config.ini .\
move Editor\startup.lua .\
move Editor\languages .\
move Editor\fonts .\
- name: Package Editor
uses: actions/upload-artifact@v4
with:
name: Editor (Windows) [Cmake build]
path: |
languages/
fonts/
config.ini
startup.lua
Editor_Windows.exe
linux:
runs-on: ubuntu-latest
name: linux (${{ matrix.cc }})
+6
View File
@@ -43,6 +43,12 @@ To build Wicked Engine for Windows 10 or newer, open the `WickedEngine.sln` solu
If you want to develop a C++ application that uses Wicked Engine, you can build the WickedEngine_Windows static library project and link against it. Including the `"WickedEngine.h"` header will attempt to link the binaries for the appropriate platform, but search directories should be set up beforehand. For example, you can set additional library directories to `$(SolutionDir)BUILD\$(Platform)\$(Configuration)` by default. For examples, see the `Samples/Template_Windows`, `Samples/Tests`, and `Editor_Windows` projects.
You can also use cmake to build on windows with these commands:
```
cmake -B build
cmake --build build --config Release
```
<img align="right" src="https://github.com/turanszkij/wickedengine-gifs/raw/main/fps.gif" width="320px"/>
#### Linux