Skip to content

Commit 487c3de

Browse files
committed
Create .github/workflows/build-nabla.yml, update CMakePresets.json for ClangCL vendor, leave minor comments to top CMakeLists.txt
1 parent 6eecd13 commit 487c3de

File tree

4 files changed

+140
-4
lines changed

4 files changed

+140
-4
lines changed

.github/workflows/build-nabla.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Build Nabla Workflow
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-windows:
10+
runs-on: windows-2022
11+
12+
env:
13+
image: ghcr.io/devsh-graphics-programming/docker-nanoserver-msvc-winsdk
14+
entry: pwsh.exe
15+
cmd: -NoLogo -NoProfile -ExecutionPolicy Bypass
16+
mount: C:\mount\nabla
17+
binary: C:\mount\nabla\build-ct
18+
install: C:\mount\nabla\build-ct\install
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
vendor: [msvc, clangcl]
24+
config: [Release, Debug, RelWithDebInfo]
25+
tag: ['17.13.6']
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
submodules: 'true'
32+
33+
- name: Set prefix
34+
id: set-prefix
35+
run: |
36+
echo "prefix=run-windows-${{ matrix.tag }}-${{ matrix.vendor }}-${{ matrix.config }}" >> $GITHUB_OUTPUT
37+
38+
- name: Pull Image
39+
run: docker pull "${{ env.image }}:${{ matrix.tag }}"
40+
41+
- name: Run Container
42+
run: |
43+
docker run \
44+
--entrypoint ${{ env.entry }} -di --isolation process \
45+
--env-file .\docker\ci-windows.env \
46+
--env-file .\docker\ninja.env \
47+
--name orphan \
48+
-v "${{ github.workspace }}:${{ env.mount }}" \
49+
-w "${{ env.mount }}" \
50+
"${{ env.image }}:${{ matrix.tag }}" \
51+
${{ env.cmd }}
52+
53+
- name: Inspect Container
54+
run: docker inspect orphan
55+
56+
- name: Container -- Configure Project with CMake
57+
run: |
58+
docker exec orphan \
59+
${{ env.entry }} ${{ env.cmd }} cmake \
60+
--preset ci-configure-dynamic-${{ matrix.vendor }} \
61+
--profiling-output=profiling/cmake-profiling.json \
62+
--profiling-format=google-trace
63+
64+
- name: Container -- Build NSC
65+
run: |
66+
docker exec orphan \
67+
${{ env.entry }} ${{ env.cmd }} cmake --build \
68+
--preset ci-build-dynamic-${{ matrix.vendor }} \
69+
-t nsc --config ${{ matrix.config }}
70+
71+
- name: Container -- Install NSC
72+
run: |
73+
docker exec orphan \
74+
${{ env.entry }} ${{ env.cmd }} cmake --install \
75+
${{ env.binary }} --config ${{ matrix.config }} \
76+
--component Runtimes --prefix ${{ env.install }}
77+
78+
docker exec orphan \
79+
${{ env.entry }} ${{ env.cmd }} cmake --install \
80+
${{ env.binary }} --config ${{ matrix.config }} \
81+
--component Executables --prefix ${{ env.install }}
82+
83+
- name: Package workflow artifacts
84+
run: |
85+
tar -cvf "${{ steps.set-prefix.outputs.prefix }}-profiling.tar" -C profiling .
86+
tar -cvf "${{ steps.set-prefix.outputs.prefix }}-install.tar" -C ${{ env.install }} .
87+
88+
- name: Upload profiling artifacts
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: ${{ steps.set-prefix.outputs.prefix }}-profiling
92+
path: ${{ steps.set-prefix.outputs.prefix }}-profiling.tar
93+
94+
- name: Upload install artifacts
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: ${{ steps.set-prefix.outputs.prefix }}-install
98+
path: ${{ steps.set-prefix.outputs.prefix }}-install.tar

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
1+
# Copyright (C) 2018-2025 - DevSH Graphics Programming Sp. z O.O.
22
# This file is part of the "Nabla Engine".
33
# For conditions of distribution and use, see copyright notice in nabla.h.in or nabla.h
44
cmake_minimum_required(VERSION 3.31)
@@ -33,7 +33,9 @@ if(MSVC)
3333
link_libraries(delayimp)
3434
endif()
3535

36+
# TODO: TO BE KILLED, keep both in one tree
3637
option(NBL_STATIC_BUILD "" OFF) # ON for static builds, OFF for shared
38+
3739
option(NBL_COMPILER_DYNAMIC_RUNTIME "" ON)
3840
option(NBL_SANITIZE_ADDRESS OFF)
3941

CMakePresets.json

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"name": "ci-configure-base",
1111
"hidden": true,
1212
"cacheVariables": {
13-
"NBL_CI_MODE": "ON",
1413
"NBL_UPDATE_GIT_SUBMODULE": "OFF",
1514
"NBL_COMPILE_WITH_CUDA": "OFF",
1615
"NBL_BUILD_OPTIX": "OFF",
@@ -19,7 +18,6 @@
1918
"_NBL_COMPILE_WITH_OPEN_EXR_": "ON",
2019
"NBL_EXPLICIT_MODULE_LOAD_LOG": "ON",
2120
"NBL_CPACK_NO_BUILD_DIRECTORY_MODULES": "ON",
22-
"NBL_RUN_TESTS": "ON",
2321
"NBL_CPACK_CI": "ON",
2422
"GIT_FAIL_IF_NONZERO_EXIT": "OFF"
2523
}
@@ -104,6 +102,22 @@
104102
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/docker/msvc-winsdk/cmake/winsdk-msvc-toolchain.cmake"
105103
}
106104
},
105+
{
106+
"name": "ci-configure-static-clangcl",
107+
"inherits": "ci-configure-static-windows-base",
108+
"generator": "Ninja Multi-Config",
109+
"cacheVariables": {
110+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/docker/msvc-winsdk/cmake/winsdk-clangcl-toolchain.cmake"
111+
}
112+
},
113+
{
114+
"name": "ci-configure-dynamic-clangcl",
115+
"inherits": "ci-configure-dynamic-windows-base",
116+
"generator": "Ninja Multi-Config",
117+
"cacheVariables": {
118+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/docker/msvc-winsdk/cmake/winsdk-clangcl-toolchain.cmake"
119+
}
120+
},
107121
{
108122
"name": "user-configure-base",
109123
"hidden": true,
@@ -316,6 +330,28 @@
316330
"lhs": "$env{NBL_CI_MODE}",
317331
"rhs": "ON"
318332
}
333+
},
334+
{
335+
"name": "ci-build-static-clangcl",
336+
"configurePreset": "ci-configure-static-clangcl",
337+
"inheritConfigureEnvironment": true,
338+
"inherits": "build-windows-base",
339+
"condition": {
340+
"type": "equals",
341+
"lhs": "$env{NBL_CI_MODE}",
342+
"rhs": "ON"
343+
}
344+
},
345+
{
346+
"name": "ci-build-dynamic-clangcl",
347+
"configurePreset": "ci-configure-dynamic-clangcl",
348+
"inheritConfigureEnvironment": true,
349+
"inherits": "build-windows-base",
350+
"condition": {
351+
"type": "equals",
352+
"lhs": "$env{NBL_CI_MODE}",
353+
"rhs": "ON"
354+
}
319355
},
320356
{
321357
"name": "user-build-static-msvc",

docker/ninja.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
NINJA_STATUS="[%r jobs, %f/%t edges, %oe/s, elapsed %ws]: "
1+
NINJA_STATUS=[%r jobs, %f/%t edges, %oe/s, elapsed %ws]:

0 commit comments

Comments
 (0)