Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #16

Merged
merged 39 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5e27de3
fix compilation on linux
Arthapz Feb 4, 2024
757cd5e
apply clang-format
Arthapz Feb 4, 2024
aee9b01
apply clang-format
Arthapz Feb 4, 2024
3e0bbd0
include missing <version> header for <stacktrace> feature testing
Arthapz Feb 4, 2024
5060c85
add formatter for gpu::PhysicalDevice
Arthapz Feb 4, 2024
4f4b67f
use std::ranges support of std::format
Arthapz Feb 4, 2024
0f45984
fix constructors of gpu::Device
Arthapz Feb 4, 2024
0047446
update xmake.lua and add Stacktrace fallback
Arthapz Feb 6, 2024
cf1b56d
update packages
Arthapz Feb 6, 2024
d71076c
initialize libbacktrace
Arthapz Feb 6, 2024
ff64eb6
initialize render engine
Arthapz Feb 6, 2024
43c24a2
update CI
Arthapz Feb 6, 2024
ff2897a
update CI
Arthapz Feb 6, 2024
fb94eae
update macOS CI
Arthapz Feb 6, 2024
2f115df
Update macOS CI
Arthapz Feb 6, 2024
7c07f6a
update Windows CI
Arthapz Feb 6, 2024
d6835a9
update macOS CI
Arthapz Feb 6, 2024
037b2bb
update CI
Arthapz Feb 6, 2024
2c0b7d1
test
Arthapz Feb 6, 2024
fe45e00
update Windows CI
Arthapz Feb 6, 2024
58e2e54
update Windows CI
Arthapz Feb 6, 2024
c1b5fbc
update Windows CI
Arthapz Feb 6, 2024
44cfa33
Update Windows CI
Arthapz Feb 6, 2024
6b38c03
don't install libbacktrace on windows
Arthapz Feb 6, 2024
e1e512a
update CI
Arthapz Feb 6, 2024
502570a
Update Windows CI
Arthapz Feb 6, 2024
ad4697e
update macOS CI
Arthapz Feb 6, 2024
859287a
update CI
Arthapz Feb 6, 2024
67ee5f2
Update CI
Arthapz Feb 6, 2024
4edea17
Update CI
Arthapz Feb 6, 2024
29ae1ea
Update CI
Arthapz Feb 6, 2024
3a7a960
fix assert function when STORMKIT_ASSERT is not defined
Arthapz Feb 6, 2024
9d56f2c
test
Arthapz Feb 6, 2024
e871ae3
fix isEqual
Arthapz Feb 6, 2024
3f996fd
make DeferInit constexpr
Arthapz Feb 6, 2024
1a4fa77
add options to individually enable examples
Arthapz Feb 6, 2024
308fad8
add auto merger action
Arthapz Feb 6, 2024
c3d67b1
fix auto merger
Arthapz Feb 6, 2024
0bf37f3
fix auto merger
Arthapz Feb 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ NamespaceIndentation: All
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: '0'
PointerAlignment: Right
PointerAlignment: Left
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterTemplateKeyword: 'false'
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/AutoMerger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Automerge

on:
schedule:
- cron: '0 0 * * 0'

env:
MY_REPO: https://Arthapz:${{secrets.GITHUB_TOKEN}}@github.com/TapzCrew/StormKit.git
MY_BRANCH: develop

MASTER_REPO: https://github.com/TapzCrew/StormKit.git
MASTER_BRANCH: main

jobs:
merge:
runs-on: ubuntu-latest

steps:
- name: Merge with master
run: |
git clone ${{env.MY_REPO}} -b ${{env.MY_BRANCH}} tmp
cd tmp
git config user.name "Automerge Bot"
git config user.email "arthur.laurent4@gmail.com"
git config pull.rebase false
git pull ${{env.MASTER_REPO}} ${{env.MASTER_BRANCH}}
git push

26 changes: 19 additions & 7 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ on:
- 'LICENSE'
- 'README.md'

push:
branches: [develop]
paths-ignore:
- '.github/workflows/Windows-MSVC.yml'
- '.github/workflows/Linux.yml'
- '.github/workflows/macOS.yml'
- '.github/workflows/iOS.yml'
- '.github/workflows/Android.yml'
- '.gitignore'
- 'LICENSE'
- 'README.md'

jobs:
build:
name: ${{ matrix.os }}-x64 ( ${{ matrix.kind }}-${{ matrix.mode }} )
Expand Down Expand Up @@ -48,30 +60,30 @@ jobs:
xmake-version: branch@dev
actions-cache-folder: .xmake-cache-${{ steps.cache_key.outputs.key }}

- name: Update xmake repository
run: xmake repo -vD --update
- name: Update xmake to patched xmake
run: xmake update -s https://github.com/Arthapz/xmake.git#modules

- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT

- name: Retrieve cached xmake dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ matrix.os }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-${{ steps.cache_key.outputs.key }}

- name: Configure & Build
id: build
run: |
xmake f -vD --yes -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --sanitizers=${{ matrix.mode == 'asan' && 'y' || 'n' }} --enable_examples=y --enable_tests=y --enable_gpu=n --libc++=y --toolchain=llvm --mold=y --sdk=/opt/llvm-git/usr --ldflags="-L/opt/llvm-git/usr/lib" --shflags="-L/opt/llvm-git/usr/lib"
xmake b -vD
xmake f -v --yes -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --sanitizers=${{ matrix.mode == 'asan' && 'y' || 'n' }} --examples=y --tests=y --toolchain=llvm --mold=y --runtimes="c++_shared" --sdk="/opt/llvm-git/usr"
xmake b -v

- name: Tests
run: LD_LIBRARY_PATH="/opt/llvm-git/usr/lib" xmake test -vD
run: LD_LIBRARY_PATH="/opt/llvm-git/usr/lib" xmake test -v

- name: Installation
run: xmake install -vD --installdir="${{ runner.workspace }}/output"
run: xmake install -v --installdir="${{ runner.workspace }}/output"

- name: Upload artifacts
id: upload
Expand Down
46 changes: 31 additions & 15 deletions .github/workflows/Windows-LLVM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ on:
- 'LICENSE'
- 'README.md'

push:
branches: [develop]
paths-ignore:
- '.github/workflows/Windows-MSVC.yml'
- '.github/workflows/Linux.yml'
- '.github/workflows/macOS.yml'
- '.github/workflows/iOS.yml'
- '.github/workflows/Android.yml'
- '.gitignore'
- 'LICENSE'
- 'README.md'


jobs:
build:
name: ${{ matrix.os }}-LLVM-${{ matrix.arch }} ( ${{ matrix.kind }}-${{ matrix.mode }} )
Expand Down Expand Up @@ -49,22 +62,25 @@ jobs:

- name: Cache LLVM
id: cache_llvm
uses: actions/cache@v3.2.2
uses: actions/cache@v4
with:
path: ${{ runner.workspace }}/StormKit/llvm/
key: ${{ matrix.os }}-llvm
save-always: true
restore-keys: |
${{ matrix.os }}-llvm

- name: Download and Uncompress LLVM
if: ${{ steps.cache_llvm.outputs.cache-hit != 'true' }}
run: |
C:/msys64/usr/bin/wget 'https://github.com/Arthapz/llvm-patched/raw/main/windows/llvm-x64.7z'
7z x llvm-x64.7z
rm llvm-x64.7z
C:/msys64/usr/bin/wget 'https://github.com/Arthapz/llvm-prebuilt/raw/main/Windows/llvm.7z.001'
C:/msys64/usr/bin/wget 'https://github.com/Arthapz/llvm-prebuilt/raw/main/Windows/llvm.7z.002'
7z x llvm.7z.001
rm llvm.7z.001
rm llvm.7z.002

- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $env:GITHUB_ENV
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Install xmake
uses: xmake-io/github-action-setup-xmake@v1
Expand All @@ -73,35 +89,35 @@ jobs:
actions-cache-folder: .xmake-cache-${{ steps.cache_key.outputs.key }}

- name: Update xmake to patched xmake
run: xmake update -s https://github.com/Arthapz/xmake.git#modules
run: xmake update -s --integrate github:Arthapz/xmake#modules

- name: Update xmake repository
run: xmake repo --update -v

# - name: Update xmake repository
# run: xmake repo --update
#
- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" >> $env:GITHUB_OUTPUT
run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append

- name: Retrieve cached xmake dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ matrix.os }}-LLVM-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-${{ steps.cache_key.outputs.key }}

- name: Configure & Build
id: build_llvm
run: |
xmake f -vD --yes -a ${{ matrix.arch }} -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --enable_examples=y --toolchain=llvm --sdk="${{ runner.workspace }}/StormKit/llvm/" --runtimes="c++_shared"
xmake b -vD
xmake f -v --yes -a ${{ matrix.arch }} -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --examples=y --tests=y --toolchain=llvm --sdk="${{ runner.workspace }}/StormKit/llvm/" --runtimes="c++_shared"
xmake b -v

- name: Tests
run: |
cp "${{ runner.workspace }}/StormKit/llvm/lib/c++.dll" "${{ runner.workspace }}/StormKit/build/windows/${{ matrix.arch }}/${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }}/"
xmake test -vD
xmake test -v

- name: Installation
run: |
xmake install -vD --installdir="${{ runner.workspace }}/output"
xmake install -v --installdir="${{ runner.workspace }}/output"
cp "${{ runner.workspace }}/StormKit/llvm/lib/c++.dll" "${{ runner.workspace }}/output/bin/"
rmdir /s /q "StormKit"

Expand Down
46 changes: 31 additions & 15 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ on:
- 'LICENSE'
- 'README.md'

push:
branches: [develop]
paths-ignore:
- '.github/workflows/Windows-MSVC.yml'
- '.github/workflows/Linux.yml'
- '.github/workflows/macOS.yml'
- '.github/workflows/iOS.yml'
- '.github/workflows/Android.yml'
- '.gitignore'
- 'LICENSE'
- 'README.md'

jobs:
build:
name: ${{ matrix.os }}-x64 ( ${{ matrix.kind }}-${{ matrix.mode }} )
Expand Down Expand Up @@ -41,13 +53,21 @@ jobs:

- name: Cache LLVM
id: cache_llvm
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ runner.workspace }}/StormKit/llvm
path: ${{ runner.workspace }}/StormKit/llvm-minified
key: ${{ matrix.os }}-llvm
save-always: true
restore-keys: |
${{ matrix.os }}-llvm

- name: Download and Uncompress LLVM
if: ${{ steps.cache_llvm.outputs.cache-hit != 'true' }}
run: |
wget 'https://github.com/Arthapz/llvm-prebuilt/raw/main/macOS/llvm.7z.001'
7z x llvm.7z.001
rm llvm.7z.001

- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV

Expand All @@ -57,37 +77,33 @@ jobs:
xmake-version: branch@dev
actions-cache-folder: .xmake-cache-${{ steps.cache_key.outputs.key }}

- name: Update xmake to patched xmake
run: xmake update -s https://github.com/Arthapz/xmake.git#modules

- name: Update xmake repository
run: xmake repo -vD --update
run: xmake repo --update -v

- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT

- name: Retrieve cached xmake dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: macOS-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-${{ steps.cache_key.outputs.key }}

- name: Download and Uncompress LLVM
if: ${{ steps.cache_llvm.outputs.cache-hit != 'true' }}
run: |
wget 'http://86.221.35.29:1337/llvm-macos.7z'
7z x llvm-macos.7z
rm llvm-macos.7z

- name: Configure & Build
id: build
run: |
xmake f -vD --yes -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --sanitizers=${{ matrix.mode == 'asan' && 'y' || 'n' }} --enable_examples=y --enable_tests=y --enable_gpu=n --libc++=y --toolchain=llvm --sdk="${{ runner.workspace }}/StormKit/llvm/" --ldflags="-L${{ runner.workspace }}/StormKit/llvm/lib" --shflags="-L${{ runner.workspace }}/StormKit/llvm/lib"
xmake b -vD
xmake f -v --yes -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --sanitizers=${{ matrix.mode == 'asan' && 'y' || 'n' }} --examples=y --tests=y --toolchain=llvm --sdk="${{ runner.workspace }}/StormKit/llvm-minified/" --runtimes="c++_shared"
xmake b -v

- name: Tests
run: DYLD_LIBRARY_PATH="${{ runner.workspace }}/StormKit/llvm/lib" xmake test -vD
run: DYLD_LIBRARY_PATH="${{ runner.workspace }}/StormKit/llvm/lib" xmake test -v

- name: Installation
run: xmake install -vD --installdir="${{ runner.workspace }}/output"
run: xmake install -v --installdir="${{ runner.workspace }}/output"

- name: Upload artifacts
id: upload
Expand Down
1 change: 0 additions & 1 deletion examples/engine/triangle/src/Constants.mpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import std;
import stormkit.Core;
import stormkit.Log;


export {
struct Vertex {
stormkit::core::math::Vector2F position;
Expand Down
18 changes: 10 additions & 8 deletions examples/engine/triangle/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,27 @@ import stormkit.Wsi;

import App;

#include <stormkit/Main/MainMacro.hpp>
#include <stormkit/Core/PlatformMacro.hpp>
#include <stormkit/Main/MainMacro.hpp>

////////////////////////////////////////
////////////////////////////////////////
auto main(std::span<const std::string_view> args) -> int {
using namespace stormkit;

stormkit::core::printStacktrace();

wsi::parseArgs(args);
// core::setupSignalHandler();

auto logger = log::Logger::createLoggerInstance<log::ConsoleLogger>();
logger.ilog("Using StormKit {}.{}.{} (branch: {}, commit_hash: {}), built with {}",
core::STORMKIT_MAJOR_VERSION,
core::STORMKIT_MINOR_VERSION,
core::STORMKIT_PATCH_VERSION,
core::STORMKIT_GIT_BRANCH,
core::STORMKIT_GIT_COMMIT_HASH,
STORMKIT_COMPILER);
logger.ilog("Using StormKit {}.{}.{}\n branch: {}\n commit_hash: {}\n built with {}",
core::STORMKIT_MAJOR_VERSION,
core::STORMKIT_MINOR_VERSION,
core::STORMKIT_PATCH_VERSION,
core::STORMKIT_GIT_BRANCH,
core::STORMKIT_GIT_COMMIT_HASH,
STORMKIT_COMPILER);

try {
auto app = App {};
Expand Down
56 changes: 28 additions & 28 deletions examples/engine/triangle/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
-- add_requires("nzsl", { configs = { fs_watcher = false } })
--
-- target("triangle")
-- do
-- set_kind("binary")
-- set_languages("cxxlatest", "clatest")
--
-- -- add_rules("@nzsl/compile.shaders")
-- add_rules("compile.shaders")
-- add_deps("stormkit-core", "stormkit-main", "stormkit-log", "stormkit-wsi", "stormkit-engine")
--
-- if is_mode("debug") then
-- add_defines("STORMKIT_BUILD_DEBUG")
-- add_defines("STORMKIT_ASSERT=1")
-- set_suffixname("-d")
-- else
-- add_defines("STORMKIT_ASSERT=0")
-- end
--
-- add_files("src/*.cpp")
-- add_files("src/*.mpp")
-- add_files("shaders/*.nzsl")
-- if is_plat("windows") then
-- add_files("win32/*.manifest")
-- end
--
-- set_group("examples/stormkit-engine")
-- end
add_requires("nzsl", { configs = { runtimes = "", fs_watcher = false } })

target("triangle")
do
set_kind("binary")
set_languages("cxxlatest", "clatest")

-- add_rules("@nzsl/compile.shaders")
add_rules("compile.shaders")
add_deps("stormkit-core", "stormkit-main", "stormkit-log", "stormkit-wsi", "stormkit-engine")

if is_mode("debug") then
add_defines("STORMKIT_BUILD_DEBUG")
add_defines("STORMKIT_ASSERT=1")
set_suffixname("-d")
else
add_defines("STORMKIT_ASSERT=0")
end

add_files("src/*.cpp")
add_files("src/*.mpp")
add_files("shaders/*.nzsl")
if is_plat("windows") then
add_files("win32/*.manifest")
end

set_group("examples/stormkit-engine")
end
Loading
Loading