Skip to content

Commit

Permalink
Merge pull request #15 from TapzCrew/develop
Browse files Browse the repository at this point in the history
merge develop into master
  • Loading branch information
Arthapz authored Feb 4, 2024
2 parents ff6380e + 1b61090 commit e634f51
Show file tree
Hide file tree
Showing 39 changed files with 648 additions and 4,171 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/Windows-LLVM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,33 @@ jobs:
id: cache_llvm
uses: actions/cache@v3.2.2
with:
path: ${{ runner.workspace }}/StormKit/llvm2/
path: ${{ runner.workspace }}/StormKit/llvm/
key: ${{ matrix.os }}-llvm
restore-keys: |
${{ matrix.os }}-llvm
- name: Download and Uncompress LLVM
if: ${{ steps.cache_llvm.outputs.cache-hit != 'true' }}
run: |
C:/msys64/usr/bin/wget 'http://86.221.35.29:1337/llvm-win.7z'
7z x llvm-win.7z
rm llvm-win.7z
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
- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $env:GITHUB_ENV

- name: Install xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: branch@dev
xmake-version: "branch@dev"
actions-cache-folder: .xmake-cache-${{ steps.cache_key.outputs.key }}

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

# - 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
Expand All @@ -88,18 +91,18 @@ jobs:
- 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 --enable_tests=y --enable_gpu=n --libc++=y --toolchain=llvm --sdk="${{ runner.workspace }}/StormKit/llvm2/" --libc++=y --cxxflags="-stdlib=libc++ -fno-delayed-template-parsing -cxx-isystem${{ runner.workspace }}/StormKit/llvm2/include/c++/v1" --ldflags="-stdlib=libc++ -L${{ runner.workspace }}/StormKit/llvm2/lib" --shflags="-stdlib=libc++ -L${{ runner.workspace }}/StormKit/llvm2/lib"
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
- name: Tests
run: |
cp "${{ runner.workspace }}/StormKit/llvm2/lib/c++.dll" "${{ runner.workspace }}/StormKit/build/windows/${{ matrix.arch }}/${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }}/"
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
- name: Installation
run: |
xmake install -vD --installdir="${{ runner.workspace }}/output"
cp "${{ runner.workspace }}/StormKit/llvm2/lib/c++.dll" "${{ runner.workspace }}/output/bin/"
cp "${{ runner.workspace }}/StormKit/llvm/lib/c++.dll" "${{ runner.workspace }}/output/bin/"
rmdir /s /q "StormKit"
- name: Upload artifacts
Expand Down
11 changes: 6 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Installation

A C++23 compliant compiler is needed to build StormKit and XMake build system
A C++23 compliant compiler with std module support and XMake is needed to build StormKit

## Dependencies
### StormKit-core module
- [glm](https://github.com/g-truc/glm)
- [frozen](https://github.com/serge-sans-paille/frozen)
- [unordered_dense](github.com/martinus/unordered_dense)
- [magic_enum](https://github.com/Neargye/magic_enum)

### StormKit-image module
- [gli](https://github.com/g-truc/gli)
- [LibPNG >= 1.6](http://www.libpng.org/pub/png/libpng.html)
- [LibJPEG-turbo](https://www.libjpeg-turbo.org)

Expand All @@ -15,12 +19,9 @@ A C++23 compliant compiler is needed to build StormKit and XMake build system
- [VulkanMemoryAllocator](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator)
- [VulkanMemoryAllocator-hpp](https://github.com/YaaZ/VulkanMemoryAllocator-Hpp)

### StormKit-engine module
- [gli](https://github.com/g-truc/gli)

## Building
```
> xmake f -m <release|debug|releasedbg> -k <shared|static>
> xmake f -m <release|debug|releasedbg> -k <shared|static> --runtimes=<c++_shared|c++_static|libstdc++_shared|libstdc++_static|MT|MD|MTd|MDd>
> xmake b
```

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 = { 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
4 changes: 4 additions & 0 deletions examples/log/console-logger/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ do

add_files("src/main.cpp")

if is_plat("windows") then
add_ldflags("-Wl,/SUBSYSTEM:CONSOLE", {force = true})
end

if has_config("mold") then
add_ldflags("-Wl,-fuse-ld=mold")
add_shflags("-Wl,-fuse-ld=mold")
Expand Down
4 changes: 4 additions & 0 deletions examples/log/file-logger/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ do

add_files("src/main.cpp")

if is_plat("windows") then
add_ldflags("-Wl,/SUBSYSTEM:CONSOLE", {force = true})
end

if has_config("mold") then
add_ldflags("-Wl,-fuse-ld=mold")
add_shflags("-Wl,-fuse-ld=mold")
Expand Down
1 change: 1 addition & 0 deletions examples/wsi/event_handler/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ do
add_files("src/main.cpp")
if is_plat("windows") then
add_files("win32/*.manifest")
add_ldflags("-Wl,/SUBSYSTEM:CONSOLE", {force = true})
end

if has_config("mold") then
Expand Down
1 change: 1 addition & 0 deletions examples/wsi/polling/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ do
add_files("src/main.cpp")
if is_plat("windows") then
add_files("win32/*.manifest")
add_ldflags("-Wl,/SUBSYSTEM:WINDOWS", {force = true})
end

if has_config("mold") then
Expand Down
6 changes: 3 additions & 3 deletions include/stormkit/Core/PlatformMacro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ extern "C" {

#ifndef STORMKIT_STATIC
#ifdef STORMKIT_BUILD
#define STORMKIT_PUBLIC STORMKIT_EXPORT
#define STORMKIT_API STORMKIT_EXPORT
#else
#define STORMKIT_PUBLIC STORMKIT_IMPORT
#define STORMKIT_API STORMKIT_IMPORT
#endif
#define STORMKIT_API STORMKIT_EXPORT
// #define STORMKIT_API STORMKIT_EXPORT
#else
#define STORMKIT_PUBLIC
#define STORMKIT_API
Expand Down
Loading

0 comments on commit e634f51

Please sign in to comment.