Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
66229b0
Fixing Linux builds
Dandielo Jun 3, 2025
c4a4202
Fixing issues on Windows after changes for linux.#
Dandielo Jun 3, 2025
9c32394
Fixing build issues on HSC tools.
Dandielo Jun 3, 2025
6413b3b
Quick implementation of linux platform layer.
Dandielo Jun 4, 2025
006ca52
Removed hardcoded 'EMSDK_PYTHON' env variable.
Dandielo Jun 4, 2025
f51dfa4
Fixed Android and Webassembly builds.
Dandielo Jun 4, 2025
5307d70
Continued work on Vulkan with Wayland.
Dandielo Jun 5, 2025
580e602
Finished implementing Linux support (tested on WSL)
Dandielo Jun 6, 2025
68d5bc6
Cleared 'Settings' method since the .Environment is now set from IBT …
Dandielo Jun 6, 2025
b328f08
Limit the 'Vulkan-Shader-Compiler' Rule to Windows and Linux targets.
Dandielo Jun 6, 2025
0500042
Fixed deadlock on graph objects. (I knew it was coming)
Dandielo Jun 6, 2025
997ee02
Enable Linux validation.
Dandielo Jun 6, 2025
5cec158
Allow manual dispatching the validation workflow
Dandielo Jun 6, 2025
6a2a454
Cleanup to trigger the workflow.
Dandielo Jun 6, 2025
1e03598
Also install libc++ library for selected clang version
Dandielo Jun 6, 2025
48c37f9
Setup conan default profile
Dandielo Jun 6, 2025
40fc9fe
Use 'pwsh' as shell instead of 'powershell'
Dandielo Jun 6, 2025
3771bbc
Fix compilation error if SDL2 package was not build with support for …
Dandielo Jun 6, 2025
ee7259a
Updated 'rapidjson' package to a patched version.
Dandielo Jun 6, 2025
41e9bfb
Updated 3rdParty license information.
Dandielo Jun 6, 2025
74496ca
Implemeted naming threads on Linux targets.
Dandielo Jun 6, 2025
2b19e54
Updated license headers in all recently changed files.
Dandielo Jun 6, 2025
1dd156d
Fix creation and modification year in license headers.
Dandielo Jun 6, 2025
18c044e
Updated license headers in .bff scripts.
Dandielo Jun 6, 2025
20d4637
Implemented Storage platform API for linux.
Dandielo Jun 7, 2025
49fcf44
Impelemnted missing parts of the Threads palatform API for Linux
Dandielo Jun 7, 2025
85171d0
Implemented 'ice::current_thread::sleep' function.
Dandielo Jun 7, 2025
04ca2f1
Implemeted AIO file writing (more like writing on different threads, …
Dandielo Jun 7, 2025
80aa51e
Update code validation workflow.
Dandielo Jun 7, 2025
99be52c
Fixing build issues after latest Linux changes.
Dandielo Jun 7, 2025
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
18 changes: 17 additions & 1 deletion .github/workflows/build-dispatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
description: "Target to be build. (separated by spaces)"
required: true
type: string
clang-version:
description: "Clang tools version to be installed"
required: false
type: string

jobs:
build:
Expand All @@ -20,12 +24,24 @@ jobs:
- name: Checkout Source Code
uses: actions/checkout@v4

- name: Setup Clang ${{ inputs.clang-version }} (ubuntu-only)
if: ${{ inputs.host-platform == 'ubuntu-latest' }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ inputs.clang-version }}
sudo apt install libc++-${{ inputs.clang-version }}-dev libc++abi-${{ inputs.clang-version }}-dev

- name: Setup Conan2
uses: iceshard-engine/.github/.github/actions/conan2@main
with:
conan-cache: true
conan-cache-version: 'v1'
conan-config-url: https://github.com/iceshard-engine/conan-config.git
conan-profile-compiler: 'clang'
conan-profile-compiler-version: '${{ inputs.clang-version }}'
conan-profile-cppstd: '20'
conan-profile-libcxx: 'libc++'

- name: Setup IBT
uses: iceshard-engine/.github/.github/actions/ibt-wks@main
Expand All @@ -38,5 +54,5 @@ jobs:

# Building the actual target
- name: Build Target (${{ inputs.target }})
shell: powershell
shell: pwsh
run: ./ibt-ci build -t ${{ inputs.target }}
8 changes: 7 additions & 1 deletion .github/workflows/build-validate-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ on:
push:
paths:
- 'source/**'
- '.github/workflows/build-dispatch.yaml'
- '.github/workflows/build-validate-code.yaml'
- '!source/data/**'
workflow_dispatch:

jobs:
validate:
name: Validate (${{ matrix.project }}-${{ matrix.pipeline }}-${{ matrix.config }}, ${{ matrix.host }})
uses: ./.github/workflows/build-dispatch.yaml
strategy:
matrix:
host: [windows-latest, ubuntu-latest]
project: [all]
pipeline: [x64]
config: [Debug,Develop,Profile,Release]
include:
- host: windows-latest
- host: ubuntu-latest
clang-version: '20'
with:
host-platform: ${{ matrix.host }}
target: "${{ matrix.project }}-${{ matrix.pipeline }}-${{ matrix.config }}"
clang-version: ${{ matrix.clang-version || '' }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
# Local data
/source/data/temp
/source/data/local
/tools/scripts/generate_version.moon
/tools/scripts/*

# Specific scripts that would be nice to have in the repository
!/tools/scripts/start.moon

# Temporary files to ignore
compile_commands.json
Expand Down
11 changes: 10 additions & 1 deletion source/asset_compiler.bff
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@

/// Copyright 2024 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

.PlatformRule_GameAssets_ShadersMobile =
[
.Name = 'Assets-Shaders-Mobile'
.Requires = { 'assets-mobile', 'Step-Bake-Shaders' }
.BuildOptions = {
#if __WINDOWS__
'-c shader_tools.dll'
#else // __LINUX__
'-c libshader_tools.so'
#endif
'--param shader:target GLSL'
}
]
Expand All @@ -15,7 +20,11 @@
.Name = 'Assets-Shaders-Web'
.Requires = { 'assets-web', 'Step-Bake-Shaders' }
.BuildOptions = {
#if __WINDOWS__
'-c shader_tools.dll'
#else // __LINUX__
'-c libshader_tools.so'
#endif
'--param shader:target WGSL'
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

namespace ice
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/core/public/ice/assert_core.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
(_wassert(_CRT_WIDE(#expression), _CRT_WIDE(__FILE__), (unsigned)(__LINE__)), 0) \
); } } while(false)

#elif ISP_WEBAPP
#elif ISP_WEBAPP || ISP_LINUX

#define ICE_ASSERT_CORE(expression) ((expression) \
? (void)0 \
Expand Down
4 changes: 3 additions & 1 deletion source/code/core/core/public/ice/build/build.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ namespace ice::build

static constexpr bool is_windows = current_platform == System::Windows;

static constexpr bool is_unix = current_platform == System::Unix;
static constexpr bool is_linux = current_platform == System::Linux;

static constexpr bool is_android = current_platform == System::Android;

static constexpr bool is_webapp = current_platform == System::WebApp;

static constexpr bool is_unix = is_linux || is_android || is_webapp;


static constexpr bool is_x64 = current_platform == Architecture::x86_x64 || current_platform == Architecture::Arm64;

Expand Down
3 changes: 3 additions & 0 deletions source/code/core/core/public/ice/build/info.hxx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/// Copyright 2025 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
#include <ice/types.hxx>

Expand Down
29 changes: 13 additions & 16 deletions source/code/core/core/public/ice/build/platform.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ice::build
UWP,
Windows,
Android,
Unix,
Linux,
WebApp
};

Expand Down Expand Up @@ -109,20 +109,13 @@ namespace ice::build
.compiler = Compiler::Clang
};

static constexpr Platform platform_unix_x64_clang = {
.name = "unix-x64-clang",
.system = System::Unix,
static constexpr Platform platform_linux_x64_clang = {
.name = "linux-x64-clang",
.system = System::Linux,
.architecture = Architecture::x86_x64,
.compiler = Compiler::Clang
};

static constexpr Platform platform_unix_x64_gcc = {
.name = "unix-x64-gcc",
.system = System::Unix,
.architecture = Architecture::x86_x64,
.compiler = Compiler::GCC
};

static constexpr Platform platform_webapp_webasm32_clang = {
.name = "webapp-webasm32-clang",
.system = System::WebApp,
Expand All @@ -136,8 +129,7 @@ namespace ice::build
platform_windows_x64_clang,
platform_android_arm64_clang,
platform_android_x64_clang,
platform_unix_x64_clang,
platform_unix_x64_gcc,
platform_linux_x64_clang,
platform_webapp_webasm32_clang
};

Expand All @@ -152,6 +144,7 @@ namespace ice::build

#if defined(_WIN64)
# define ISP_UNIX 0
# define ISP_LINUX 0
# define ISP_WINDOWS 1
# define ISP_ANDROID 0
# define ISP_WEBAPP 0
Expand All @@ -173,6 +166,7 @@ namespace ice::build
# define ISP_ARCHFAM_WEBASM 0
#elif defined(__ANDROID__)
# define ISP_UNIX 1
# define ISP_LINUX 0
# define ISP_WINDOWS 0
# define ISP_ANDROID __ANDROID_API__
# define ISP_WEBAPP 0
Expand All @@ -193,6 +187,7 @@ namespace ice::build
# endif
#elif defined(EMSCRIPTEN)
# define ISP_UNIX 1
# define ISP_LINUX 0
# define ISP_WINDOWS 0
# define ISP_ANDROID 0
# define ISP_WEBAPP 1
Expand All @@ -207,6 +202,7 @@ namespace ice::build
static constexpr Platform current_platform = platform_webapp_webasm32_clang;
#elif __unix__ && !__clang__
# define ISP_UNIX 1
# define ISP_LINUX 1
# define ISP_WINDOWS 0
# define ISP_ANDROID 0
# define ISP_WEBAPP 0
Expand All @@ -220,6 +216,7 @@ namespace ice::build
static constexpr Platform current_platform = platform_unix_x64_gcc;
#elif __unix__ && __clang__
# define ISP_UNIX 1
# define ISP_LINUX 1
# define ISP_WINDOWS 0
# define ISP_ANDROID 0
# define ISP_WEBAPP 0
Expand All @@ -230,7 +227,7 @@ namespace ice::build
# define ISP_ARCHFAM_ARM 0
# define ISP_ARCHFAM_WEBASM 0

static constexpr Platform current_platform = platform_unix_x64_clang;
static constexpr Platform current_platform = platform_linux_x64_clang;
#else
# define ISP_UNIX 0
# define ISP_WINDOWS 0
Expand Down Expand Up @@ -321,8 +318,8 @@ namespace ice::build
return "windows";
case ice::build::System::Android:
return "android";
case ice::build::System::Unix:
return "unix";
case ice::build::System::Linux:
return "linux";
default:
return "<invalid>";
}
Expand Down
1 change: 0 additions & 1 deletion source/code/core/core/public/ice/clock_types.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -251,5 +251,4 @@ namespace ice

} // namespace detail::ct_tests


} // namespace ice
2 changes: 1 addition & 1 deletion source/code/core/core/public/ice/os.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2024 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2024 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/core/public/ice/os/windows.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/memsys/private/mem.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace ice
.size = size,
.alignment = alignment,
};
#elif ISP_WEBAPP || (ISP_ANDROID && ISP_ANDROID <= 29)
#elif ISP_LINUX || ISP_WEBAPP || (ISP_ANDROID && ISP_ANDROID <= 29)
void* memory_location;

[[maybe_unused]]
Expand Down
3 changes: 2 additions & 1 deletion source/code/core/memsys/private/mem_allocator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ namespace ice

auto AllocatorBase<true>::allocate(ice::AllocRequest request) noexcept -> ice::AllocResult
{
ICE_ASSERT_CORE(request.size != 0_B);
// TODO: Check if requesting sizes of '0' can be actually allowed
// ICE_ASSERT_CORE(request.size != 0_B);
ice::AllocResult result = do_allocate(request);

_internal->insert(result);
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/memsys/public/ice/mem_allocator_host.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/modules/private/module.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2024 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2024 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#include <ice/module.hxx>
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/modules/private/module_globals.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ extern "C"

} // extern "C"

#elif ISP_ANDROID
#elif ISP_ANDROID || ISP_LINUX

extern "C"
{
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/modules/private/module_globals.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2024 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2024 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/modules/private/module_native.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2024 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2024 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#include "module_native.hxx"
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/modules/private/module_native.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2024 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2024 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/modules/public/ice/module_info.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2024 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2024 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/modules/public/ice/module_query.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2024 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2024 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/modules/public/ice/module_register.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2024, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2025, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
7 changes: 6 additions & 1 deletion source/code/core/tasks/private/task_native_thread.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ namespace ice
{
emscripten_set_thread_name(pthread_self(), ice::string::begin(thread_info.debug_name));
}
#elif ISP_LINUX
if constexpr (ice::build::is_release == false)
{
pthread_setname_np(pthread_self(), ice::string::begin(thread_info.debug_name));
}
#endif

ice::ThreadRuntime& runtime = thread_obj->runtime();
Expand Down Expand Up @@ -380,7 +385,7 @@ namespace ice
{
error = pthread_attr_setstacksize(
&thread_attribs,
ice::max(ice::usize::base_type{PTHREAD_STACK_MIN}, info.stack_size.value)
ice::max(ice::usize::base_type(PTHREAD_STACK_MIN), info.stack_size.value)
);
ICE_ASSERT(
error == 0,
Expand Down
21 changes: 21 additions & 0 deletions source/code/core/tasks/private/task_thread_utils.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <ice/task_thread_utils.hxx>
#include <ice/os/windows.hxx>
#include <ice/os/unix.hxx>

namespace ice::current_thread
{

void sleep(Tms ms) noexcept
{
#if ISP_WINDOWS
ICE_ASSERT_CORE(ms.value <= ice::u32_max);
SleepEx(DWORD(ms.value), 0);
#elif ISP_UNIX
Tus const us = ms;
usleep(us.value);
#else
ICE_ASSERT_CORE(false);
#endif
}

} // namespace ice::current_thread
Loading