From 3d655aec13bdda6a8cf852da0cb0680984136eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Rodr=C3=ADguez=20Mart=C3=ADnez?= Date: Tue, 5 May 2026 14:13:35 +0200 Subject: [PATCH 01/21] Working windows build fails tests tho --- engine/src/toast/events/event.cpp | 1 + engine/src/toast/events/event.hpp | 4 ++-- engine/src/toast/log.hpp | 1 + engine/src/toast/logger.cpp | 2 +- engine/xmake.lua | 3 ++- xmake.lua | 4 ++-- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/engine/src/toast/events/event.cpp b/engine/src/toast/events/event.cpp index 91dfcdb91..0ee9b58d2 100644 --- a/engine/src/toast/events/event.cpp +++ b/engine/src/toast/events/event.cpp @@ -1,5 +1,6 @@ #include "event.hpp" +#include #include #include #include diff --git a/engine/src/toast/events/event.hpp b/engine/src/toast/events/event.hpp index 23fc50fb0..0cb1ccea4 100644 --- a/engine/src/toast/events/event.hpp +++ b/engine/src/toast/events/event.hpp @@ -58,7 +58,7 @@ inline std::unordered_map> unsubs inline std::vector> deletion_queue; /// @brief allocates memory in the event queue pool -auto allocate(std::size_t size, std::size_t align) noexcept -> void*; +auto TOAST_API allocate(std::size_t size, std::size_t align) noexcept -> void*; } /// @brief queue's up an event @@ -91,7 +91,7 @@ void TOAST_API send(Args&&... args) noexcept; /// the callback itself /// template -struct TOAST_API Event : _detail::IEvent { +struct Event : _detail::IEvent { friend class Listener; /// @brief callbacks that return 'true' are consumed and do not propogate using callback_t = std::move_only_function; diff --git a/engine/src/toast/log.hpp b/engine/src/toast/log.hpp index 274cc5ca0..071498ca5 100644 --- a/engine/src/toast/log.hpp +++ b/engine/src/toast/log.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include /// @internal diff --git a/engine/src/toast/logger.cpp b/engine/src/toast/logger.cpp index fd560045e..3561b4632 100644 --- a/engine/src/toast/logger.cpp +++ b/engine/src/toast/logger.cpp @@ -94,7 +94,7 @@ auto Logger::create() noexcept -> std::unique_ptr { #if defined(_WIN32) // On Windows, 'start /B' runs the command in the background without opening a new window // For output redirection, we need to wrap it in 'cmd /C' - if (SHOW_SERVER_LOGS) { + if (show_server_logs) { cmd = "start /B " + server_path.string(); } else { cmd = "start /B cmd /C \"" + server_path.string() + " >nul 2>&1\""; diff --git a/engine/xmake.lua b/engine/xmake.lua index c39a841ff..37604f3fa 100644 --- a/engine/xmake.lua +++ b/engine/xmake.lua @@ -17,7 +17,8 @@ target("toast.engine", function() add_ldflags("-lstdc++exp", { tools = { "clang", "gcc" }, public = true }) -- adds library for stacktrace -- Apply clang-format rule - add_rules("clang-format") + -- FIX THIS SO CLANG FORMAT ALWAYS RUNS BEFORE THE DANTE HEADERS BULLSHIT + --add_rules("clang-format") add_rules("sync-headers") if is_plat("linux") then diff --git a/xmake.lua b/xmake.lua index 261a3e31b..23d9c4c20 100644 --- a/xmake.lua +++ b/xmake.lua @@ -1,7 +1,7 @@ add_rules("mode.debug", "mode.release") set_defaultmode("debug") -set_languages("c++23") +set_languages("c++latest") rule("clang-format") before_build(function(target) @@ -39,7 +39,7 @@ end -- Enables debug optimizations, needed on newer clang and gcc versions to avoid a warning if is_mode("debug") then set_optimize("none") - add_cxxflags("-Og") + add_cxxflags("-Og", { tools = { "clang", "gcc" }}) add_defines("DEBUG") end From 41dff6d73c77a3b6f749c45a684811115544be26 Mon Sep 17 00:00:00 2001 From: Dante Harper Date: Thu, 7 May 2026 17:27:24 +0200 Subject: [PATCH 02/21] stuff --- engine/xmake.lua | 2 +- tools/xmake.lua | 23 +++++++++++++---------- xmake.lua | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/engine/xmake.lua b/engine/xmake.lua index 37604f3fa..1a519311d 100644 --- a/engine/xmake.lua +++ b/engine/xmake.lua @@ -14,7 +14,7 @@ target("toast.engine", function() -- External libraries go here -x add_packages("asio") - add_ldflags("-lstdc++exp", { tools = { "clang", "gcc" }, public = true }) -- adds library for stacktrace +-- add_syslinks("stdc++exp", { tools = { "clang", "gcc" }, public = true }) -- adds library for stacktrace -- Apply clang-format rule -- FIX THIS SO CLANG FORMAT ALWAYS RUNS BEFORE THE DANTE HEADERS BULLSHIT diff --git a/tools/xmake.lua b/tools/xmake.lua index 59fdde062..d99271756 100644 --- a/tools/xmake.lua +++ b/tools/xmake.lua @@ -1,19 +1,20 @@ add_requires("cargo::anyhow 1.0") add_requires("cargo::chrono 0.4") -add_requires("cargo::clap", {configs = {features = "derive"}}) +add_requires("cargo::clap", { configs = { features = "derive" } }) add_requires("cargo::csv 1.3.1") add_requires("cargo::crossterm 0.28.1") add_requires("cargo::prost 0.14") add_requires("cargo::prost-types 0.13.5") -add_requires("cargo::serde", {configs = {features = "derive"}}) +add_requires("cargo::serde", { configs = { features = "derive" } }) add_requires("cargo::textwrap 0.16") -add_requires("cargo::tokio", {configs = {features = "full"}}) +add_requires("cargo::tokio", { configs = { features = "full" } }) add_requires("cargo::tui-input 0.11") local tools_dir = os.scriptdir() target("player", function() set_kind("binary") + set_default(false) add_deps("toast.engine", "toast.dummy_game") add_files("player/**.cs") remove_files("player/obj/**") @@ -25,6 +26,7 @@ end) target("toast.dummy_game", function() set_kind("shared") + set_default(false) add_files("dummy_game/**.cpp") add_headerfiles("dummy_game/**.h") add_deps("toast.engine") @@ -37,31 +39,32 @@ target("kenzo", function() set_default(false) on_build(function(target) local oldir = os.cd("$(projectdir)/tools/kenzo") - + if is_mode("release") then - os.execv("cargo", {"build", "--release"}) + os.execv("cargo", { "build", "--release" }) else - os.execv("cargo", {"build"}) + os.execv("cargo", { "build" }) end - + -- Copy binary to xmake's output directory so xmake run works local target_subdir = is_mode("release") and "release" or "debug" local src_binary = "target/" .. target_subdir .. "/kenzo" local dst_dir = target:targetdir() os.mkdir(dst_dir) os.cp(src_binary, path.join(dst_dir, "kenzo")) - + os.cd(oldir) end) on_clean(function(target) local oldir = os.cd("$(projectdir)/tools/kenzo") - os.execv("cargo", {"clean"}) + os.execv("cargo", { "clean" }) os.cd(oldir) end) end) target("log_server", function() set_kind("binary") + set_default(false) -- set_languages("rust") add_files("log_server/src/main.rs") add_packages( @@ -76,6 +79,6 @@ end) target("toast.tools", function() set_kind("phony") + set_default(false) add_deps("kenzo", "log_server") end) - diff --git a/xmake.lua b/xmake.lua index 23d9c4c20..5522205c9 100644 --- a/xmake.lua +++ b/xmake.lua @@ -24,7 +24,7 @@ end) rule_end() add_rules("plugin.compile_commands.autoupdate") -add_cxxflags("-stdlib=libc++", { tools = { "clang", "gcc" } }) -- Use LLVM STL by default +add_syslinks("stdc++exp", { tools = { "clang", "gcc" } }) -- adds library for stacktrace -- Makes release have flto, fast math and SIMD intrinsic optimizations if is_mode("release") then @@ -39,7 +39,7 @@ end -- Enables debug optimizations, needed on newer clang and gcc versions to avoid a warning if is_mode("debug") then set_optimize("none") - add_cxxflags("-Og", { tools = { "clang", "gcc" }}) + add_cxxflags("-Og", { tools = { "clang", "gcc" } }) -- this line doesnt quite work add_defines("DEBUG") end From c1e01617e6ac09344906196abb97e4418a551e3e Mon Sep 17 00:00:00 2001 From: Dante Harper Date: Thu, 7 May 2026 18:23:38 +0200 Subject: [PATCH 03/21] possible fix --- engine/src/toast/events/event.cpp | 4 ++++ engine/src/toast/events/event.hpp | 12 ++++++------ engine/xmake.lua | 2 ++ xmake.lua | 5 ++++- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/engine/src/toast/events/event.cpp b/engine/src/toast/events/event.cpp index 0ee9b58d2..5c1463415 100644 --- a/engine/src/toast/events/event.cpp +++ b/engine/src/toast/events/event.cpp @@ -27,6 +27,10 @@ uint8_t index = 0; namespace _detail { +std::mutex mutex; +std::unordered_map> unsubscribe_map; +std::vector> deletion_queue; + auto allocate(std::size_t size, std::size_t align) noexcept -> void* { void* mem = pools[index].pool.allocate(size, align); pools[index].queue.push_back(reinterpret_cast(mem)); diff --git a/engine/src/toast/events/event.hpp b/engine/src/toast/events/event.hpp index 0cb1ccea4..35997aa19 100644 --- a/engine/src/toast/events/event.hpp +++ b/engine/src/toast/events/event.hpp @@ -47,15 +47,15 @@ struct TOAST_API IEvent { }; /// @brief mutex for the event system -inline std::mutex mutex; +extern TOAST_API std::mutex mutex; /// @brief vtable for unsubscribing callbacks -inline std::unordered_map> unsubscribe_map; +extern TOAST_API std::unordered_map> unsubscribe_map; /// @brief callbacks will be cleaned up only before pollEvents /// @note unique pointers have the option of storing a pointer to the function that deletes the object /// so thats how i implement the deletion_queue -inline std::vector> deletion_queue; +extern TOAST_API std::vector> deletion_queue; /// @brief allocates memory in the event queue pool auto TOAST_API allocate(std::size_t size, std::size_t align) noexcept -> void*; @@ -66,7 +66,7 @@ auto TOAST_API allocate(std::size_t size, std::size_t align) noexcept -> void*; /// @param args arguments for the constructor template requires std::is_base_of_v<_detail::IEvent, T> -void TOAST_API send(Args&&... args) noexcept; +void send(Args&&... args) noexcept; /// @class Event /// @brief Base class for all events. Derive your event type as `struct Derived : Event`. @@ -95,7 +95,7 @@ struct Event : _detail::IEvent { friend class Listener; /// @brief callbacks that return 'true' are consumed and do not propogate using callback_t = std::move_only_function; - using iterator_t = std::multimap::iterator; + using iterator_t = std::multimap>::iterator; private: static inline struct G { @@ -103,7 +103,7 @@ struct Event : _detail::IEvent { std::multimap> callbacks; std::mutex mutex; std::vector processing; - bool cached; + bool cached = false; } g; /// @brief registers a callback to the event callbacks diff --git a/engine/xmake.lua b/engine/xmake.lua index 1a519311d..b98245487 100644 --- a/engine/xmake.lua +++ b/engine/xmake.lua @@ -24,6 +24,8 @@ target("toast.engine", function() if is_plat("linux") then add_syslinks("pthread") add_shflags("-Wl,--no-as-needed") + elseif is_plat("windows", "mingw") then + add_syslinks("ws2_32", "mswsock") end end) diff --git a/xmake.lua b/xmake.lua index 5522205c9..3b8219b4d 100644 --- a/xmake.lua +++ b/xmake.lua @@ -24,7 +24,10 @@ end) rule_end() add_rules("plugin.compile_commands.autoupdate") -add_syslinks("stdc++exp", { tools = { "clang", "gcc" } }) -- adds library for stacktrace +-- add_syslinks("stdc++exp", { tools = { "clang", "gcc" } }) -- adds library for stacktrace +if is_plat("linux", "macosx") then + add_syslinks("stdc++exp") +end -- Makes release have flto, fast math and SIMD intrinsic optimizations if is_mode("release") then From f4239142d3c5d3c5704c5830890994eba19aaf4b Mon Sep 17 00:00:00 2001 From: Dante Harper Date: Sat, 9 May 2026 11:10:16 +0200 Subject: [PATCH 04/21] setup test --- engine/src/toast/events/event.inl | 1 + engine/src/toast/events/event_system.cpp | 1 + engine/src/toast/events/event_system.hpp | 14 ++++++++++++++ tests/events/01-basic.cpp | 2 ++ 4 files changed, 18 insertions(+) create mode 100644 engine/src/toast/events/event_system.cpp create mode 100644 engine/src/toast/events/event_system.hpp diff --git a/engine/src/toast/events/event.inl b/engine/src/toast/events/event.inl index 11b9609e6..3ac001fbb 100644 --- a/engine/src/toast/events/event.inl +++ b/engine/src/toast/events/event.inl @@ -10,6 +10,7 @@ namespace event { template Event::G::G() noexcept { static_assert(std::is_base_of_v, T>, "CONTRACT VIOLATION: You Must Inhert as 'struct Derived : Event'"); + TOAST_INFO(_detail::IEvent,"Registering Event Type: {}",typeid(T).name()); // add function to the Event vtable _detail::unsubscribe_map.emplace(typeid(T), [](std::any iter) { auto it = std::any_cast(iter); diff --git a/engine/src/toast/events/event_system.cpp b/engine/src/toast/events/event_system.cpp new file mode 100644 index 000000000..adf61fc0c --- /dev/null +++ b/engine/src/toast/events/event_system.cpp @@ -0,0 +1 @@ +#include "event_system.hpp" diff --git a/engine/src/toast/events/event_system.hpp b/engine/src/toast/events/event_system.hpp new file mode 100644 index 000000000..8d607332c --- /dev/null +++ b/engine/src/toast/events/event_system.hpp @@ -0,0 +1,14 @@ +/** + * @file event_system.hpp + * @author Dante Harper + * @date 09 May 26 + * + * @brief Event System Singleton + */ + +#pragma once + +#include "toast/events/event.hpp" +#include "toast/export.hpp" + +struct TOAST_API Test : event::Event { }; diff --git a/tests/events/01-basic.cpp b/tests/events/01-basic.cpp index 451e6fb1a..fcdf56179 100644 --- a/tests/events/01-basic.cpp +++ b/tests/events/01-basic.cpp @@ -1,5 +1,6 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" +#include "toast/events/event_system.hpp" #include @@ -11,6 +12,7 @@ auto main() -> int { listener.subscribe([&called](BasicEvent& e) { called = true; }); event::send(); + event::send(); event::pollEvents(); assert(called); From 34467223862b0a34575842df267ceb2fb4f007fb Mon Sep 17 00:00:00 2001 From: Dante Harper Date: Sat, 9 May 2026 11:39:38 +0200 Subject: [PATCH 05/21] meow --- tests/events/01-basic.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/events/01-basic.cpp b/tests/events/01-basic.cpp index fcdf56179..451e6fb1a 100644 --- a/tests/events/01-basic.cpp +++ b/tests/events/01-basic.cpp @@ -1,6 +1,5 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" -#include "toast/events/event_system.hpp" #include @@ -12,7 +11,6 @@ auto main() -> int { listener.subscribe([&called](BasicEvent& e) { called = true; }); event::send(); - event::send(); event::pollEvents(); assert(called); From 27baece23740872efe18664f89de18d7882beeca Mon Sep 17 00:00:00 2001 From: Dante Harper Date: Sat, 9 May 2026 11:54:11 +0200 Subject: [PATCH 06/21] meow --- engine/src/toast/events/event.cpp | 9 ++---- engine/src/toast/events/event.hpp | 15 --------- engine/src/toast/events/event.inl | 20 ++++++------ engine/src/toast/events/event_system.cpp | 7 +++++ engine/src/toast/events/event_system.hpp | 40 +++++++++++++++++++++++- engine/src/toast/events/listener.cpp | 3 +- 6 files changed, 62 insertions(+), 32 deletions(-) diff --git a/engine/src/toast/events/event.cpp b/engine/src/toast/events/event.cpp index 5c1463415..991fec89e 100644 --- a/engine/src/toast/events/event.cpp +++ b/engine/src/toast/events/event.cpp @@ -1,4 +1,5 @@ #include "event.hpp" +#include "toast/events/event_system.hpp" #include #include @@ -27,10 +28,6 @@ uint8_t index = 0; namespace _detail { -std::mutex mutex; -std::unordered_map> unsubscribe_map; -std::vector> deletion_queue; - auto allocate(std::size_t size, std::size_t align) noexcept -> void* { void* mem = pools[index].pool.allocate(size, align); pools[index].queue.push_back(reinterpret_cast(mem)); @@ -43,12 +40,12 @@ void pollEvents() noexcept { TOAST_INFO(_detail::IEvent, "Polling Events"); // delete callbacks - _detail::deletion_queue.clear(); + EventSystem::deletion_queue.clear(); // swap memory pool uint32_t idx; { - std::scoped_lock _(_detail::mutex); + std::scoped_lock _(EventSystem::pool_mutex); idx = index; index = (index + 1) % pools.size(); } diff --git a/engine/src/toast/events/event.hpp b/engine/src/toast/events/event.hpp index 35997aa19..fcdbe5022 100644 --- a/engine/src/toast/events/event.hpp +++ b/engine/src/toast/events/event.hpp @@ -10,18 +10,14 @@ */ #pragma once -#include #include #include #include #include -#include #include #include #include #include -#include -#include #include namespace event { @@ -46,17 +42,6 @@ struct TOAST_API IEvent { virtual void notify() noexcept = 0; }; -/// @brief mutex for the event system -extern TOAST_API std::mutex mutex; - -/// @brief vtable for unsubscribing callbacks -extern TOAST_API std::unordered_map> unsubscribe_map; - -/// @brief callbacks will be cleaned up only before pollEvents -/// @note unique pointers have the option of storing a pointer to the function that deletes the object -/// so thats how i implement the deletion_queue -extern TOAST_API std::vector> deletion_queue; - /// @brief allocates memory in the event queue pool auto TOAST_API allocate(std::size_t size, std::size_t align) noexcept -> void*; } diff --git a/engine/src/toast/events/event.inl b/engine/src/toast/events/event.inl index 3ac001fbb..d9dd12c25 100644 --- a/engine/src/toast/events/event.inl +++ b/engine/src/toast/events/event.inl @@ -1,5 +1,6 @@ #pragma once #include "event.hpp" +#include "toast/events/event_system.hpp" #include "toast/log.hpp" #include @@ -9,13 +10,14 @@ namespace event { template Event::G::G() noexcept { - static_assert(std::is_base_of_v, T>, "CONTRACT VIOLATION: You Must Inhert as 'struct Derived : Event'"); - TOAST_INFO(_detail::IEvent,"Registering Event Type: {}",typeid(T).name()); - // add function to the Event vtable - _detail::unsubscribe_map.emplace(typeid(T), [](std::any iter) { - auto it = std::any_cast(iter); - unsubscribe(it); - }); + // static_assert(std::is_base_of_v, T>, "CONTRACT VIOLATION: You Must Inhert as 'struct Derived : Event'"); + // TOAST_INFO(_detail::IEvent,"Registering Event Type: {}",typeid(T).name()); + // // add function to the Event vtable + // _detail::unsubscribe_map.emplace(typeid(T), [](std::any iter) { + // auto it = std::any_cast(iter); + // unsubscribe(it); + // }); + event::EventSystem::registerEvent(); } template @@ -37,7 +39,7 @@ void Event::unsubscribe(iterator_t it) noexcept { { std::scoped_lock _(g.mutex); auto deleter = [](void* p) { delete static_cast*>(p); }; - _detail::deletion_queue.emplace_back((*it).second, deleter); + EventSystem::deletion_queue.emplace_back((*it).second, deleter); g.cached = false; g.callbacks.erase(it); } @@ -76,7 +78,7 @@ void send(Args&&... args) noexcept { TOAST_TRACE(_detail::IEvent, "Sending Event: {}", typeid(T).name()); // Allocate and enqueue event { - std::scoped_lock _(_detail::mutex); + std::scoped_lock _(EventSystem::pool_mutex); void* memory = _detail::allocate(sizeof(T), alignof(T)); assert(memory); _detail::IEvent* event = new (memory) T(std::forward(args)...); diff --git a/engine/src/toast/events/event_system.cpp b/engine/src/toast/events/event_system.cpp index adf61fc0c..2c94834ff 100644 --- a/engine/src/toast/events/event_system.cpp +++ b/engine/src/toast/events/event_system.cpp @@ -1 +1,8 @@ #include "event_system.hpp" + +namespace event { +std::unordered_map EventSystem::event_data; +std::mutex EventSystem::pool_mutex; +std::unordered_map> EventSystem::unsubscribe_map; +std::vector> EventSystem::deletion_queue; +} // namespace event diff --git a/engine/src/toast/events/event_system.hpp b/engine/src/toast/events/event_system.hpp index 8d607332c..d4abc62a4 100644 --- a/engine/src/toast/events/event_system.hpp +++ b/engine/src/toast/events/event_system.hpp @@ -11,4 +11,42 @@ #include "toast/events/event.hpp" #include "toast/export.hpp" -struct TOAST_API Test : event::Event { }; +#include +#include +#include + +namespace event { +struct TOAST_API EventSystem { + struct EventInfo { + std::mutex mutex; + std::multimap> callbacks; + std::vector processing; + bool cached = false; + }; + + /// @brief mutex for the event system pool + static std::mutex pool_mutex; + + /// @brief vtable for unsubscribing callbacks + static std::unordered_map> unsubscribe_map; + + /// @brief callbacks will be cleaned up only before pollEvents + /// @note unique pointers have the option of storing a pointer to the function that deletes the object + /// so thats how i implement the deletion_queue + static std::vector> deletion_queue; + + static std::unordered_map event_data; + + + template + static void registerEvent() { + static_assert(std::is_base_of_v, T>, "CONTRACT VIOLATION: You Must Inhert as 'struct Derived : Event'"); + TOAST_INFO(_detail::IEvent, "Registering Event Type: {}", typeid(T).name()); + + EventSystem::unsubscribe_map.emplace(typeid(T), [](const std::any& iter) { + auto it = std::any_cast(iter); + unsubscribe(it); + }); + } +}; +} diff --git a/engine/src/toast/events/listener.cpp b/engine/src/toast/events/listener.cpp index 9a998c215..368f0170a 100644 --- a/engine/src/toast/events/listener.cpp +++ b/engine/src/toast/events/listener.cpp @@ -1,6 +1,7 @@ #include "listener.hpp" #include "event.hpp" +#include "toast/events/event_system.hpp" namespace event { @@ -10,7 +11,7 @@ Listener::Listener() { Listener::~Listener() { for (auto& [type, name, callback] : m.callbacks) { - _detail::unsubscribe_map[type](callback); + EventSystem::unsubscribe_map[type](callback); } } From 3fbc2f69cdbcd464e864f209ec026214fa280ef3 Mon Sep 17 00:00:00 2001 From: Dante Harper Date: Sat, 9 May 2026 12:01:13 +0200 Subject: [PATCH 07/21] meow --- engine/src/toast/events/event.cpp | 6 ++- engine/src/toast/events/event.hpp | 53 +++++++++++++++++++++++- engine/src/toast/events/event.inl | 1 - engine/src/toast/events/event_system.cpp | 8 ---- engine/src/toast/events/event_system.hpp | 52 ----------------------- engine/src/toast/events/listener.cpp | 1 - 6 files changed, 57 insertions(+), 64 deletions(-) delete mode 100644 engine/src/toast/events/event_system.cpp delete mode 100644 engine/src/toast/events/event_system.hpp diff --git a/engine/src/toast/events/event.cpp b/engine/src/toast/events/event.cpp index 991fec89e..adeec8418 100644 --- a/engine/src/toast/events/event.cpp +++ b/engine/src/toast/events/event.cpp @@ -1,5 +1,4 @@ #include "event.hpp" -#include "toast/events/event_system.hpp" #include #include @@ -13,6 +12,11 @@ namespace event { +std::unordered_map EventSystem::event_data; +std::mutex EventSystem::pool_mutex; +std::unordered_map> EventSystem::unsubscribe_map; +std::vector> EventSystem::deletion_queue; + namespace { struct Pool { alignas(64) std::array buffer; diff --git a/engine/src/toast/events/event.hpp b/engine/src/toast/events/event.hpp index fcdbe5022..e524e2238 100644 --- a/engine/src/toast/events/event.hpp +++ b/engine/src/toast/events/event.hpp @@ -10,9 +10,13 @@ */ #pragma once +#include "toast/log.hpp" #include #include #include +#include +#include +#include #include #include #include @@ -104,6 +108,53 @@ struct Event : _detail::IEvent { void notify() noexcept override; }; -} + + + + +struct TOAST_API EventSystem { + struct EventInfo { + std::mutex mutex; + std::multimap> callbacks; + std::vector processing; + bool cached = false; + }; + + /// @brief mutex for the event system pool + static std::mutex pool_mutex; + + /// @brief vtable for unsubscribing callbacks + static std::unordered_map> unsubscribe_map; + + /// @brief callbacks will be cleaned up only before pollEvents + /// @note unique pointers have the option of storing a pointer to the function that deletes the object + /// so thats how i implement the deletion_queue + static std::vector> deletion_queue; + + static std::unordered_map event_data; + + + template + static void registerEvent() { + static_assert(std::is_base_of_v, T>, "CONTRACT VIOLATION: You Must Inhert as 'struct Derived : Event'"); + TOAST_INFO(_detail::IEvent, "Registering Event Type: {}", typeid(T).name()); + + EventSystem::unsubscribe_map.emplace(typeid(T), [](const std::any& iter) { + auto it = std::any_cast::iterator_t>(iter); + unsubscribe(it); + }); + } +}; + + + + + + + + + + +} #include "event.inl" diff --git a/engine/src/toast/events/event.inl b/engine/src/toast/events/event.inl index d9dd12c25..d2ce0732b 100644 --- a/engine/src/toast/events/event.inl +++ b/engine/src/toast/events/event.inl @@ -1,6 +1,5 @@ #pragma once #include "event.hpp" -#include "toast/events/event_system.hpp" #include "toast/log.hpp" #include diff --git a/engine/src/toast/events/event_system.cpp b/engine/src/toast/events/event_system.cpp deleted file mode 100644 index 2c94834ff..000000000 --- a/engine/src/toast/events/event_system.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "event_system.hpp" - -namespace event { -std::unordered_map EventSystem::event_data; -std::mutex EventSystem::pool_mutex; -std::unordered_map> EventSystem::unsubscribe_map; -std::vector> EventSystem::deletion_queue; -} // namespace event diff --git a/engine/src/toast/events/event_system.hpp b/engine/src/toast/events/event_system.hpp deleted file mode 100644 index d4abc62a4..000000000 --- a/engine/src/toast/events/event_system.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file event_system.hpp - * @author Dante Harper - * @date 09 May 26 - * - * @brief Event System Singleton - */ - -#pragma once - -#include "toast/events/event.hpp" -#include "toast/export.hpp" - -#include -#include -#include - -namespace event { -struct TOAST_API EventSystem { - struct EventInfo { - std::mutex mutex; - std::multimap> callbacks; - std::vector processing; - bool cached = false; - }; - - /// @brief mutex for the event system pool - static std::mutex pool_mutex; - - /// @brief vtable for unsubscribing callbacks - static std::unordered_map> unsubscribe_map; - - /// @brief callbacks will be cleaned up only before pollEvents - /// @note unique pointers have the option of storing a pointer to the function that deletes the object - /// so thats how i implement the deletion_queue - static std::vector> deletion_queue; - - static std::unordered_map event_data; - - - template - static void registerEvent() { - static_assert(std::is_base_of_v, T>, "CONTRACT VIOLATION: You Must Inhert as 'struct Derived : Event'"); - TOAST_INFO(_detail::IEvent, "Registering Event Type: {}", typeid(T).name()); - - EventSystem::unsubscribe_map.emplace(typeid(T), [](const std::any& iter) { - auto it = std::any_cast(iter); - unsubscribe(it); - }); - } -}; -} diff --git a/engine/src/toast/events/listener.cpp b/engine/src/toast/events/listener.cpp index 368f0170a..6d5fbe141 100644 --- a/engine/src/toast/events/listener.cpp +++ b/engine/src/toast/events/listener.cpp @@ -1,7 +1,6 @@ #include "listener.hpp" #include "event.hpp" -#include "toast/events/event_system.hpp" namespace event { From 090b2c39ea9b40a00c6e28784f3d9faf145d05f2 Mon Sep 17 00:00:00 2001 From: Dante Harper Date: Sat, 9 May 2026 12:56:27 +0200 Subject: [PATCH 08/21] maybe fixed --- engine/src/toast/events/event.hpp | 63 ++++++++++++++++--------------- engine/src/toast/events/event.inl | 21 +++++------ 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/engine/src/toast/events/event.hpp b/engine/src/toast/events/event.hpp index e524e2238..8a76a228a 100644 --- a/engine/src/toast/events/event.hpp +++ b/engine/src/toast/events/event.hpp @@ -11,21 +11,24 @@ #pragma once #include "toast/log.hpp" + +#include #include #include #include -#include -#include -#include #include +#include #include #include #include #include +#include #include namespace event { +struct EventSystem; // Forward declaration + /// @brief dispatches all queued events to their callbacks /// @note Not thread-safe. Should be only ever called from a single thread / main thread void TOAST_API pollEvents() noexcept; @@ -82,20 +85,22 @@ void send(Args&&... args) noexcept; template struct Event : _detail::IEvent { friend class Listener; + friend struct EventSystem; /// @brief callbacks that return 'true' are consumed and do not propogate using callback_t = std::move_only_function; - using iterator_t = std::multimap>::iterator; + using iterator_t = std::multimap>::iterator; private: - static inline struct G { - G() noexcept; - std::multimap> callbacks; - std::mutex mutex; - std::vector processing; - bool cached = false; - } g; + static inline struct _Registrar { + _Registrar(); // Declared, not defined inline + bool registered; + } registrar; + + static void ensureRegistered() { + (void)registrar; // Casting to void "uses" the variable + } - /// @brief registers a callback to the event callbacks + /// @brief registers a callback to the event callbacks /// @param priority higher number callbacks first /// @param callback static auto subscribe(char priority, callback_t&& callback) noexcept -> iterator_t; @@ -108,11 +113,6 @@ struct Event : _detail::IEvent { void notify() noexcept override; }; - - - - - struct TOAST_API EventSystem { struct EventInfo { std::mutex mutex; @@ -121,6 +121,9 @@ struct TOAST_API EventSystem { bool cached = false; }; + /// @brief callback map for each type of event + static std::unordered_map event_data; + /// @brief mutex for the event system pool static std::mutex pool_mutex; @@ -132,29 +135,27 @@ struct TOAST_API EventSystem { /// so thats how i implement the deletion_queue static std::vector> deletion_queue; - static std::unordered_map event_data; - - template static void registerEvent() { static_assert(std::is_base_of_v, T>, "CONTRACT VIOLATION: You Must Inhert as 'struct Derived : Event'"); + if (event_data.contains(typeid(T))) { + TOAST_INFO(_detail::IEvent, "Registered Again Because Windows Is Shit", typeid(T).name()); + return; + } TOAST_INFO(_detail::IEvent, "Registering Event Type: {}", typeid(T).name()); + event_data.emplace( + std::piecewise_construct, + std::forward_as_tuple(typeid(T)), + std::forward_as_tuple() // This calls the EventInfo() constructor + ); EventSystem::unsubscribe_map.emplace(typeid(T), [](const std::any& iter) { - auto it = std::any_cast::iterator_t>(iter); - unsubscribe(it); + auto it = std::any_cast::iterator_t>(iter); + Event::unsubscribe(it); }); } }; - - - - - - - - - } + #include "event.inl" diff --git a/engine/src/toast/events/event.inl b/engine/src/toast/events/event.inl index d2ce0732b..4bbb42f82 100644 --- a/engine/src/toast/events/event.inl +++ b/engine/src/toast/events/event.inl @@ -2,32 +2,28 @@ #include "event.hpp" #include "toast/log.hpp" +#include #include #include namespace event { template -Event::G::G() noexcept { - // static_assert(std::is_base_of_v, T>, "CONTRACT VIOLATION: You Must Inhert as 'struct Derived : Event'"); - // TOAST_INFO(_detail::IEvent,"Registering Event Type: {}",typeid(T).name()); - // // add function to the Event vtable - // _detail::unsubscribe_map.emplace(typeid(T), [](std::any iter) { - // auto it = std::any_cast(iter); - // unsubscribe(it); - // }); - event::EventSystem::registerEvent(); +Event::_Registrar::_Registrar() : registered(true) { + EventSystem::registerEvent(); } template auto Event::subscribe(char priority, callback_t&& callback) noexcept -> iterator_t { + (void)registrar.registered; TOAST_TRACE(_detail::IEvent, "Subscribing Callback To: {}", typeid(T).name()); auto cb = new callback_t(std::move(callback)); + auto& g = EventSystem::event_data[typeid(T)]; { std::scoped_lock _(g.mutex); g.cached = false; - return g.callbacks.emplace(priority, cb); + return g.callbacks.emplace(priority, static_cast(cb)); } } @@ -35,6 +31,7 @@ template void Event::unsubscribe(iterator_t it) noexcept { TOAST_TRACE(_detail::IEvent, "Unsubscribing Callback To: {}", typeid(T).name()); + auto& g = EventSystem::event_data[typeid(T)]; { std::scoped_lock _(g.mutex); auto deleter = [](void* p) { delete static_cast*>(p); }; @@ -47,6 +44,8 @@ void Event::unsubscribe(iterator_t it) noexcept { template void Event::notify() noexcept { TOAST_TRACE(_detail::IEvent, "Notifying Event: {}", typeid(T).name()); + + auto& g = EventSystem::event_data[typeid(T)]; { // build cached list of all the callbacks in order // locks mutex for the shortest period possible @@ -63,7 +62,7 @@ void Event::notify() noexcept { // disptaches all of the callbacks for (auto& callback : g.processing) { - bool handled = (*callback)(static_cast(*this)); + bool handled = (*static_cast(callback))(static_cast(*this)); if (handled) { return; } From edf3be3ccdea477db531437d9d7ca08baddd5466 Mon Sep 17 00:00:00 2001 From: Dante Harper Date: Sat, 9 May 2026 12:58:19 +0200 Subject: [PATCH 09/21] meow --- engine/src/toast/events/event.hpp | 20 ++++++++------------ engine/src/toast/events/event.inl | 4 +++- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/engine/src/toast/events/event.hpp b/engine/src/toast/events/event.hpp index 8a76a228a..3f575f821 100644 --- a/engine/src/toast/events/event.hpp +++ b/engine/src/toast/events/event.hpp @@ -88,19 +88,15 @@ struct Event : _detail::IEvent { friend struct EventSystem; /// @brief callbacks that return 'true' are consumed and do not propogate using callback_t = std::move_only_function; - using iterator_t = std::multimap>::iterator; + using iterator_t = std::multimap>::iterator; private: - static inline struct _Registrar { - _Registrar(); // Declared, not defined inline + static inline struct Registrar { + Registrar(); bool registered; } registrar; - static void ensureRegistered() { - (void)registrar; // Casting to void "uses" the variable - } - - /// @brief registers a callback to the event callbacks + /// @brief registers a callback to the event callbacks /// @param priority higher number callbacks first /// @param callback static auto subscribe(char priority, callback_t&& callback) noexcept -> iterator_t; @@ -144,10 +140,10 @@ struct TOAST_API EventSystem { } TOAST_INFO(_detail::IEvent, "Registering Event Type: {}", typeid(T).name()); event_data.emplace( - std::piecewise_construct, - std::forward_as_tuple(typeid(T)), - std::forward_as_tuple() // This calls the EventInfo() constructor - ); + std::piecewise_construct, + std::forward_as_tuple(typeid(T)), + std::forward_as_tuple() // This calls the EventInfo() constructor + ); EventSystem::unsubscribe_map.emplace(typeid(T), [](const std::any& iter) { auto it = std::any_cast::iterator_t>(iter); diff --git a/engine/src/toast/events/event.inl b/engine/src/toast/events/event.inl index 4bbb42f82..50b4204ef 100644 --- a/engine/src/toast/events/event.inl +++ b/engine/src/toast/events/event.inl @@ -9,7 +9,7 @@ namespace event { template -Event::_Registrar::_Registrar() : registered(true) { +Event::Registrar::Registrar() : registered(true) { EventSystem::registerEvent(); } @@ -29,6 +29,7 @@ auto Event::subscribe(char priority, callback_t&& callback) noexcept -> itera template void Event::unsubscribe(iterator_t it) noexcept { + (void)registrar.registered; TOAST_TRACE(_detail::IEvent, "Unsubscribing Callback To: {}", typeid(T).name()); auto& g = EventSystem::event_data[typeid(T)]; @@ -43,6 +44,7 @@ void Event::unsubscribe(iterator_t it) noexcept { template void Event::notify() noexcept { + (void)registrar.registered; TOAST_TRACE(_detail::IEvent, "Notifying Event: {}", typeid(T).name()); auto& g = EventSystem::event_data[typeid(T)]; From e635f0d6531deaa629972b26396e6d8fda4d68a6 Mon Sep 17 00:00:00 2001 From: Dante Harper Date: Sat, 9 May 2026 13:19:32 +0200 Subject: [PATCH 10/21] more fixes --- engine/src/toast/events/event.hpp | 2 +- engine/src/toast/events/event.inl | 1 - engine/src/toast/events/listener.cpp | 5 +++++ engine/src/toast/events/listener.hpp | 6 +++++- engine/src/toast/events/listener.inl | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/engine/src/toast/events/event.hpp b/engine/src/toast/events/event.hpp index 3f575f821..1c7928c1e 100644 --- a/engine/src/toast/events/event.hpp +++ b/engine/src/toast/events/event.hpp @@ -135,7 +135,7 @@ struct TOAST_API EventSystem { static void registerEvent() { static_assert(std::is_base_of_v, T>, "CONTRACT VIOLATION: You Must Inhert as 'struct Derived : Event'"); if (event_data.contains(typeid(T))) { - TOAST_INFO(_detail::IEvent, "Registered Again Because Windows Is Shit", typeid(T).name()); + TOAST_INFO(_detail::IEvent, "Event type {} already registered (Windows Is Shit)", typeid(T).name()); return; } TOAST_INFO(_detail::IEvent, "Registering Event Type: {}", typeid(T).name()); diff --git a/engine/src/toast/events/event.inl b/engine/src/toast/events/event.inl index 50b4204ef..4da9833d8 100644 --- a/engine/src/toast/events/event.inl +++ b/engine/src/toast/events/event.inl @@ -2,7 +2,6 @@ #include "event.hpp" #include "toast/log.hpp" -#include #include #include diff --git a/engine/src/toast/events/listener.cpp b/engine/src/toast/events/listener.cpp index 6d5fbe141..10dbc22a7 100644 --- a/engine/src/toast/events/listener.cpp +++ b/engine/src/toast/events/listener.cpp @@ -8,6 +8,10 @@ Listener::Listener() { m.enabled = true; } +Listener::Listener(bool state) { + m.enabled = state; +} + Listener::~Listener() { for (auto& [type, name, callback] : m.callbacks) { EventSystem::unsubscribe_map[type](callback); @@ -22,4 +26,5 @@ void Listener::enabled(bool state) { auto Listener::enabled() const -> bool { return m.enabled; } + } diff --git a/engine/src/toast/events/listener.hpp b/engine/src/toast/events/listener.hpp index 19ccc35c7..348440ee8 100644 --- a/engine/src/toast/events/listener.hpp +++ b/engine/src/toast/events/listener.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -49,12 +50,15 @@ class TOAST_API Listener { public: Listener(); + + Listener(bool state); + ~Listener(); /// @brief unsubscribes every event in type TEvent with that name /// @param name event callback name/s to remove template - void unsubscribe(std::string name) noexcept; + void unsubscribe(std::string_view name) noexcept; /// @brief subscribes a callback to an TEvent /// @param name of the callback diff --git a/engine/src/toast/events/listener.inl b/engine/src/toast/events/listener.inl index 554c73e43..6eed2288f 100644 --- a/engine/src/toast/events/listener.inl +++ b/engine/src/toast/events/listener.inl @@ -7,7 +7,7 @@ namespace event { template -void Listener::unsubscribe(std::string name) noexcept { +void Listener::unsubscribe(std::string_view name) noexcept { TOAST_TRACE(Listener, "Unsubscribing Callback {} to {}", name, typeid(TEvent).name()); std::erase_if(m.callbacks, [&](auto& callback) { auto& [type, sub_name, any] = callback; From 29939eb0c67065d3cab4a2f234419e5ad8fe0db7 Mon Sep 17 00:00:00 2001 From: Xein Date: Sat, 9 May 2026 13:38:22 +0200 Subject: [PATCH 11/21] github workflows improved --- .github/workflows/clang-format.yml | 44 ++++++ .github/workflows/clang-tidy.yml | 45 ++++++ .github/workflows/draft-dev-to-main.yml | 103 +++++++++++++ .github/workflows/release-on-merge.yml | 87 +++++++++++ .github/workflows/test-linux-release.yml | 43 ++++++ .github/workflows/test-linux.yml | 44 ++++++ .github/workflows/test-windows-release.yml | 47 ++++++ .github/workflows/test-windows.yml | 48 ++++++ .github/workflows/tests.yml | 163 --------------------- 9 files changed, 461 insertions(+), 163 deletions(-) create mode 100644 .github/workflows/clang-format.yml create mode 100644 .github/workflows/clang-tidy.yml create mode 100644 .github/workflows/draft-dev-to-main.yml create mode 100644 .github/workflows/release-on-merge.yml create mode 100644 .github/workflows/test-linux-release.yml create mode 100644 .github/workflows/test-linux.yml create mode 100644 .github/workflows/test-windows-release.yml create mode 100644 .github/workflows/test-windows.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml new file mode 100644 index 000000000..221fd1e6b --- /dev/null +++ b/.github/workflows/clang-format.yml @@ -0,0 +1,44 @@ +name: clang-format + +on: + pull_request: + branches: + - dev + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: clang-format-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + format: + name: clang-format + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + persist-credentials: true + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Run clang-format + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + bash ./tools/ci/clang_format.sh diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml new file mode 100644 index 000000000..36e27be8d --- /dev/null +++ b/.github/workflows/clang-tidy.yml @@ -0,0 +1,45 @@ +name: clang-tidy + +on: + pull_request: + branches: + - dev + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: clang-tidy-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + tidy: + name: clang-tidy + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Generate compile_commands + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + xmake project -k compile_commands -y + + - name: Run clang-tidy + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + bash ./tools/ci/clang_tidy.sh diff --git a/.github/workflows/draft-dev-to-main.yml b/.github/workflows/draft-dev-to-main.yml new file mode 100644 index 000000000..8f4490fd1 --- /dev/null +++ b/.github/workflows/draft-dev-to-main.yml @@ -0,0 +1,103 @@ +name: draft-dev-to-main + +on: + pull_request: + branches: + - dev + types: + - closed + +permissions: + contents: read + pull-requests: write + issues: write + +jobs: + draft: + name: create dev -> main draft + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true && github.event.pull_request.base.repo.fork == false && github.event.pull_request.base.repo.full_name == github.repository + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Fetch main and dev + shell: bash + run: | + set -euo pipefail + git fetch origin main dev --prune --tags + + - name: Determine next tag + id: version + shell: bash + run: | + set -euo pipefail + + ahead_count="$(git rev-list --count origin/main..origin/dev)" + if [[ "${ahead_count}" -le 0 ]]; then + echo "dev is not ahead of main; skipping." + echo "create_pr=false" >> "${GITHUB_OUTPUT}" + exit 0 + fi + + latest_tag="$(git tag --list "2.*.*" --sort=-version:refname | head -n 1 || true)" + if [[ -z "${latest_tag}" ]]; then + new_tag="2.0.0" + else + IFS='.' read -r major minor patch <<< "${latest_tag}" + minor=$((minor + 1)) + patch=0 + new_tag="${major}.${minor}.${patch}" + fi + + echo "new_tag=${new_tag}" >> "${GITHUB_OUTPUT}" + echo "create_pr=true" >> "${GITHUB_OUTPUT}" + + - name: Create draft PR if missing + if: steps.version.outputs.create_pr == 'true' + uses: actions/github-script@v7 + with: + script: | + const owner = context.repo.owner; + const repo = context.repo.repo; + const tag = "${{ steps.version.outputs.new_tag }}"; + + const existing = await github.rest.pulls.list({ + owner, + repo, + state: "open", + base: "main", + head: `${owner}:dev` + }); + + if (existing.data.length > 0) { + core.info("Open dev -> main PR already exists; skipping."); + return; + } + + const pr = await github.rest.pulls.create({ + owner, + repo, + title: `Toast Engine v${tag}`, + head: "dev", + base: "main", + body: "", + draft: true + }); + + await github.rest.pulls.requestReviewers({ + owner, + repo, + pull_number: pr.data.number, + reviewers: ["ynks"] + }); + + await github.rest.issues.addAssignees({ + owner, + repo, + issue_number: pr.data.number, + assignees: ["ynks"] + }); diff --git a/.github/workflows/release-on-merge.yml b/.github/workflows/release-on-merge.yml new file mode 100644 index 000000000..2cb3fe064 --- /dev/null +++ b/.github/workflows/release-on-merge.yml @@ -0,0 +1,87 @@ +name: release-on-merge + +on: + pull_request: + branches: + - main + types: + - closed + +permissions: + contents: write + +jobs: + release: + name: tag and release + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true && github.event.pull_request.base.repo.fork == false && github.event.pull_request.base.repo.full_name == github.repository + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + persist-credentials: true + + - name: Determine next tag + id: version + shell: bash + env: + HEAD_REF: ${{ github.event.pull_request.head.ref }} + MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }} + run: | + set -euo pipefail + + latest_tag="$(git tag --list "2.*.*" --sort=-version:refname | head -n 1 || true)" + if [[ -z "${latest_tag}" ]]; then + if [[ "${HEAD_REF}" == "dev" ]]; then + new_tag="2.0.0" + else + echo "No existing 2.*.* tags and merge is not dev -> main. Skipping." + echo "create_release=false" >> "${GITHUB_OUTPUT}" + exit 0 + fi + else + IFS='.' read -r major minor patch <<< "${latest_tag}" + if [[ "${HEAD_REF}" == "dev" ]]; then + minor=$((minor + 1)) + patch=0 + elif [[ "${HEAD_REF}" == hotfix/* ]]; then + patch=$((patch + 1)) + else + echo "Head ref '${HEAD_REF}' does not match dev or hotfix/*; skipping." + echo "create_release=false" >> "${GITHUB_OUTPUT}" + exit 0 + fi + new_tag="${major}.${minor}.${patch}" + fi + + if git rev-parse -q --verify "refs/tags/${new_tag}" > /dev/null; then + echo "Tag ${new_tag} already exists; skipping." + echo "create_release=false" >> "${GITHUB_OUTPUT}" + exit 0 + fi + + echo "new_tag=${new_tag}" >> "${GITHUB_OUTPUT}" + echo "merge_sha=${MERGE_SHA}" >> "${GITHUB_OUTPUT}" + echo "create_release=true" >> "${GITHUB_OUTPUT}" + + - name: Create tag + if: steps.version.outputs.create_release == 'true' + run: | + git tag "${{ steps.version.outputs.new_tag }}" "${{ steps.version.outputs.merge_sha }}" + git push origin "refs/tags/${{ steps.version.outputs.new_tag }}" + + - name: Create GitHub release + if: steps.version.outputs.create_release == 'true' + uses: actions/github-script@v7 + with: + script: | + const tag = "${{ steps.version.outputs.new_tag }}"; + await github.rest.repos.createRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: tag, + name: `Toast Engine v${tag}`, + body: "" + }); diff --git a/.github/workflows/test-linux-release.yml b/.github/workflows/test-linux-release.yml new file mode 100644 index 000000000..f6ec14525 --- /dev/null +++ b/.github/workflows/test-linux-release.yml @@ -0,0 +1,43 @@ +name: test-linux-release + +on: + pull_request: + branches: + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: test-linux-release-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + test: + name: test linux release + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Run tests (Linux) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + xmake f -m release -y + xmake test -y diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml new file mode 100644 index 000000000..b6b332e27 --- /dev/null +++ b/.github/workflows/test-linux.yml @@ -0,0 +1,44 @@ +name: test-linux + +on: + pull_request: + branches: + - dev + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: test-linux-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + test: + name: test linux + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Run tests (Linux) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + xmake f -m debug -y + xmake test -y diff --git a/.github/workflows/test-windows-release.yml b/.github/workflows/test-windows-release.yml new file mode 100644 index 000000000..0211882cf --- /dev/null +++ b/.github/workflows/test-windows-release.yml @@ -0,0 +1,47 @@ +name: test-windows-release + +on: + pull_request: + branches: + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: test-windows-release-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + test: + name: test windows release + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + + - name: Setup .NET 10 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Run tests (Windows) + run: | + xmake f -m release -y + xmake test -y diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml new file mode 100644 index 000000000..8e801f5bd --- /dev/null +++ b/.github/workflows/test-windows.yml @@ -0,0 +1,48 @@ +name: test-windows + +on: + pull_request: + branches: + - dev + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: test-windows-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + test: + name: test windows + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + + - name: Setup .NET 10 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Run tests (Windows) + run: | + xmake f -m debug -y + xmake test -y diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index a1bd59af7..000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,163 +0,0 @@ -name: tests - -on: - pull_request: - branches: - - dev - types: - - opened - - reopened - - synchronize - - edited - -permissions: - contents: read - pull-requests: read - -concurrency: - group: tests-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - format: - name: clang-format - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: read - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - persist-credentials: true - - - name: Install Nix - uses: cachix/install-nix-action@v30 - - - name: Run clang-format - run: | - eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" - bash ./tools/ci/clang_format.sh - - build: - name: build ${{ matrix.os }} - needs: format - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: - - ubuntu-latest - - windows-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Setup Nix - if: runner.os == 'Linux' - uses: cachix/install-nix-action@v30 - - - name: Setup xmake - if: runner.os == 'Windows' - uses: xmake-io/github-action-setup-xmake@v1 - - - name: Setup .NET - if: runner.os == 'Windows' - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "10.0.x" - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Build (Linux) - if: runner.os == 'Linux' - run: | - eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" - xmake f -m debug - xmake --all - - - name: Build (Windows) - if: runner.os == 'Windows' - run: xmake f -m debug && xmake --all - - test: - name: test ${{ matrix.os }} - needs: build - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: - - ubuntu-latest - - windows-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Install Nix - if: runner.os == 'Linux' - uses: cachix/install-nix-action@v30 - - - name: Setup xmake - if: runner.os == 'Windows' - uses: xmake-io/github-action-setup-xmake@v1 - - - name: Setup .NET 10 - if: runner.os == 'Windows' - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "10.0.x" - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Run tests (Linux) - if: runner.os == 'Linux' - run: | - eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" - xmake f -m debug - xmake test - - - name: Run tests (Windows) - if: runner.os == 'Windows' - run: | - xmake f -m debug - xmake test - - tidy: - name: clang-tidy - needs: test - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Install Nix - uses: cachix/install-nix-action@v30 - - - name: Generate compile_commands - run: | - eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" - xmake project -k compile_commands - - - name: Run clang-tidy - run: | - eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" - bash ./tools/ci/clang_tidy.sh - From 1e2d981ab75977bb173c78e11f5774c4b098a687 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 May 2026 11:40:16 +0000 Subject: [PATCH 12/21] ci: apply clang-format to engine --- engine/src/toast/events/event.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/toast/events/event.inl b/engine/src/toast/events/event.inl index 4da9833d8..2f9c98aa7 100644 --- a/engine/src/toast/events/event.inl +++ b/engine/src/toast/events/event.inl @@ -9,7 +9,7 @@ namespace event { template Event::Registrar::Registrar() : registered(true) { - EventSystem::registerEvent(); + EventSystem::registerEvent(); } template From 471811197526bddca9df8be9e3fe518948c09f13 Mon Sep 17 00:00:00 2001 From: Dante Harper Date: Sat, 9 May 2026 13:04:35 +0200 Subject: [PATCH 13/21] some random fixes --- engine/src/toast/events/event.hpp | 2 +- engine/xmake.lua | 5 ++++- pch.h | 32 +++++++++++++++++++++++++++++++ tests/xmake.lua | 4 +++- xmake.lua | 9 ++++----- 5 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 pch.h diff --git a/engine/src/toast/events/event.hpp b/engine/src/toast/events/event.hpp index 1c7928c1e..4318c2709 100644 --- a/engine/src/toast/events/event.hpp +++ b/engine/src/toast/events/event.hpp @@ -45,7 +45,7 @@ struct TOAST_API IEvent { #endif private: - friend void event::pollEvents() noexcept; + friend void TOAST_API event::pollEvents() noexcept; virtual void notify() noexcept = 0; }; diff --git a/engine/xmake.lua b/engine/xmake.lua index b98245487..eb8dc90d5 100644 --- a/engine/xmake.lua +++ b/engine/xmake.lua @@ -11,10 +11,13 @@ target("toast.engine", function() add_files("**.cpp") add_headerfiles("src/(**.hpp)", { public = false, extra = { check = true } }) add_headerfiles("ffi/(**.h)", "include/toast/(**.hpp)", { prefixdir = "toast", extra = { check = true } }) + set_pcxxheader("../pch.h") -- External libraries go here -x add_packages("asio") --- add_syslinks("stdc++exp", { tools = { "clang", "gcc" }, public = true }) -- adds library for stacktrace + if not is_plat("windows") then + add_syslinks("stdc++exp") + end -- Apply clang-format rule -- FIX THIS SO CLANG FORMAT ALWAYS RUNS BEFORE THE DANTE HEADERS BULLSHIT diff --git a/pch.h b/pch.h new file mode 100644 index 000000000..e021e921d --- /dev/null +++ b/pch.h @@ -0,0 +1,32 @@ +/** + * @file pch.h + * @author Dante Harper + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/tests/xmake.lua b/tests/xmake.lua index 7cb400de7..580b18f9c 100644 --- a/tests/xmake.lua +++ b/tests/xmake.lua @@ -13,7 +13,9 @@ for _, filepath in ipairs(os.files(path.join(scriptdir, "**.cpp"))) do add_files(filepath) add_deps("toast.engine") - + if not is_plat("windows") then + add_syslinks("stdc++exp") + end add_defines("UNIT_TESTING") diff --git a/xmake.lua b/xmake.lua index 3b8219b4d..ab33d7587 100644 --- a/xmake.lua +++ b/xmake.lua @@ -24,10 +24,7 @@ end) rule_end() add_rules("plugin.compile_commands.autoupdate") --- add_syslinks("stdc++exp", { tools = { "clang", "gcc" } }) -- adds library for stacktrace -if is_plat("linux", "macosx") then - add_syslinks("stdc++exp") -end + -- Makes release have flto, fast math and SIMD intrinsic optimizations if is_mode("release") then @@ -42,7 +39,9 @@ end -- Enables debug optimizations, needed on newer clang and gcc versions to avoid a warning if is_mode("debug") then set_optimize("none") - add_cxxflags("-Og", { tools = { "clang", "gcc" } }) -- this line doesnt quite work + if not is_plat("windows") then + add_cxxflags("-Og") + end add_defines("DEBUG") end From 625b5a9b900fe4a131b86c5fbc6e08e673f41303 Mon Sep 17 00:00:00 2001 From: Xein Date: Sat, 9 May 2026 15:24:15 +0200 Subject: [PATCH 14/21] a bit more CI changes --- .github/workflows/branch_rules.yml | 2 +- .github/workflows/clang-format.yml | 4 ---- tools/ci/clang_format.sh | 16 +--------------- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/branch_rules.yml b/.github/workflows/branch_rules.yml index ea653c685..04b296388 100644 --- a/.github/workflows/branch_rules.yml +++ b/.github/workflows/branch_rules.yml @@ -1,4 +1,4 @@ -name: branch_rules +name: branch-rules on: pull_request: diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 221fd1e6b..0ffbdfb08 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -23,9 +23,6 @@ jobs: format: name: clang-format runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: read steps: - name: Checkout PR branch uses: actions/checkout@v4 @@ -33,7 +30,6 @@ jobs: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.head_ref }} fetch-depth: 0 - persist-credentials: true - name: Install Nix uses: cachix/install-nix-action@v30 diff --git a/tools/ci/clang_format.sh b/tools/ci/clang_format.sh index dcf575d26..9dc87f54a 100644 --- a/tools/ci/clang_format.sh +++ b/tools/ci/clang_format.sh @@ -22,20 +22,6 @@ nix --extra-experimental-features "nix-command flakes" develop .#default -c bash exit 0 fi - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add -- "${files[@]}" - - if ! git commit -m "ci: apply clang-format to engine"; then - echo "Formatting changes detected, but nothing was committed." - exit 1 - fi - - if git push; then - echo "Formatting fixes were pushed to the PR branch. Continuing with the updated commit in this run." - exit 0 - fi - - echo "::error::Formatting changes were detected, but this workflow could not push fixes. Format locally and push." + echo "::error::Formatting changes detected. Run clang-format locally and push the results." exit 1 ' From 0d74c9048bad1934e54a734fa84c0ce4e2db117f Mon Sep 17 00:00:00 2001 From: Xein Date: Sat, 9 May 2026 15:53:05 +0200 Subject: [PATCH 15/21] Fixed library exception error with GCC on windows Honestly theres no way i would have figured this out on my own ngl, github copilot tokens saved me ngl Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- engine/xmake.lua | 8 ++++++++ tests/xmake.lua | 3 +++ 2 files changed, 11 insertions(+) diff --git a/engine/xmake.lua b/engine/xmake.lua index eb8dc90d5..89a67c06f 100644 --- a/engine/xmake.lua +++ b/engine/xmake.lua @@ -18,6 +18,14 @@ target("toast.engine", function() if not is_plat("windows") then add_syslinks("stdc++exp") end + if is_plat("windows") and (get_config("toolchain") == "mingw" or get_config("toolchain") == "gcc") then + add_syslinks("stdc++exp") + add_defines("__cpp_lib_constexpr_exceptions=0") + on_load(function(target) + local implib = path.join(target:targetdir(), "lib" .. target:name() .. ".dll.a") + target:add("shflags", "-Wl,--out-implib," .. implib, { force = true }) + end) + end -- Apply clang-format rule -- FIX THIS SO CLANG FORMAT ALWAYS RUNS BEFORE THE DANTE HEADERS BULLSHIT diff --git a/tests/xmake.lua b/tests/xmake.lua index 580b18f9c..45dd44da2 100644 --- a/tests/xmake.lua +++ b/tests/xmake.lua @@ -16,6 +16,9 @@ for _, filepath in ipairs(os.files(path.join(scriptdir, "**.cpp"))) do if not is_plat("windows") then add_syslinks("stdc++exp") end + if is_plat("windows") and (get_config("toolchain") == "mingw" or get_config("toolchain") == "gcc") then + add_syslinks("stdc++exp") + end add_defines("UNIT_TESTING") From 4fdcdc89305ae112e3bb439b6166bf8799ea90fe Mon Sep 17 00:00:00 2001 From: Xein Date: Sat, 9 May 2026 16:08:44 +0200 Subject: [PATCH 16/21] Lol i didn't see this was getting gitignored because it had the word "build" --- .github/workflows/.gitignore | 4 ++ .github/workflows/build-linux-release.yml | 43 +++++++++++++++++++ .github/workflows/build-linux.yml | 44 ++++++++++++++++++++ .github/workflows/build-windows-release.yml | 45 ++++++++++++++++++++ .github/workflows/build-windows.yml | 46 +++++++++++++++++++++ 5 files changed, 182 insertions(+) create mode 100644 .github/workflows/.gitignore create mode 100644 .github/workflows/build-linux-release.yml create mode 100644 .github/workflows/build-linux.yml create mode 100644 .github/workflows/build-windows-release.yml create mode 100644 .github/workflows/build-windows.yml diff --git a/.github/workflows/.gitignore b/.github/workflows/.gitignore new file mode 100644 index 000000000..e63fcbedb --- /dev/null +++ b/.github/workflows/.gitignore @@ -0,0 +1,4 @@ +!build-linux.yml +!build-linux-release.yml +!build-windows.yml +!build-windows-release.yml \ No newline at end of file diff --git a/.github/workflows/build-linux-release.yml b/.github/workflows/build-linux-release.yml new file mode 100644 index 000000000..f1f8709c3 --- /dev/null +++ b/.github/workflows/build-linux-release.yml @@ -0,0 +1,43 @@ +name: build-linux-release + +on: + pull_request: + branches: + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: build-linux-release-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + build: + name: build linux release + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Build (Linux) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + xmake f -m release -y + xmake --all -y diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 000000000..35d050c24 --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,44 @@ +name: build-linux + +on: + pull_request: + branches: + - dev + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: build-linux-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + build: + name: build linux + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Build (Linux) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + xmake f -m debug -y + xmake --all -y diff --git a/.github/workflows/build-windows-release.yml b/.github/workflows/build-windows-release.yml new file mode 100644 index 000000000..46daa3ae4 --- /dev/null +++ b/.github/workflows/build-windows-release.yml @@ -0,0 +1,45 @@ +name: build-windows-release + +on: + pull_request: + branches: + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: build-windows-release-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + build: + name: build windows release + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Build (Windows) + run: xmake f -m release -y && xmake --all -y diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 000000000..dd5b3259c --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,46 @@ +name: build-windows + +on: + pull_request: + branches: + - dev + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: build-windows-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + build: + name: build windows + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Build (Windows) + run: xmake f -m debug -y && xmake --all -y From 7ff5a71d4579453a241968a698dca0beaf02e7ea Mon Sep 17 00:00:00 2001 From: Xein Date: Tue, 12 May 2026 13:22:30 +0200 Subject: [PATCH 17/21] the change --- .../{branch_rules.yml => branch-rules.yml} | 0 .gitignore | 3 +- CMakeLists.txt | 25 ++++ README.md | 18 +-- cmake/clang_format.cmake | 33 ++++++ cmake/sync_api_headers.cmake | 51 +++++++++ editor/App.axaml | 15 +++ editor/App.axaml.cs | 31 +++++ editor/Assets/avalonia-logo.ico | Bin 0 -> 175875 bytes editor/CMakeLists.txt | 22 ++++ editor/Program.cs | 24 ++++ editor/ViewLocator.cs | 37 ++++++ editor/ViewModels/MainWindowViewModel.cs | 6 + editor/ViewModels/ViewModelBase.cs | 7 ++ editor/Views/MainWindow.axaml | 20 ++++ editor/Views/MainWindow.axaml.cs | 11 ++ editor/app.manifest | 18 +++ editor/editor.csproj | 26 +++++ editor/xmake.lua | 31 ----- engine/CMakeLists.txt | 40 +++++++ pch.h => engine/pch.h | 0 engine/xmake.lua | 108 ------------------ flake.nix | 4 +- tests/CMakeLists.txt | 36 ++++++ tests/README.md | 0 tests/events/01-basic.cpp | 5 +- tests/events/02-priority.cpp | 6 +- tests/events/03-consume.cpp | 6 +- tests/events/04-named.cpp | 7 +- tests/events/05-arguments.cpp | 6 +- tests/events/06-nested.cpp | 6 +- tests/events/07-lifecycle.cpp | 6 +- tests/events/08-multiple.cpp | 7 +- tests/events/09-unsubscribe_all.cpp | 6 +- tests/events/10-concurrent_send.cpp | 6 +- tests/test_registry.hpp | 33 ++++++ tests/test_runner.cpp | 67 +++++++++++ tests/xmake.lua | 32 ------ tools/CMakeLists.txt | 4 + tools/dummy_game/CMakeLists.txt | 5 + tools/kenzo/CMakeLists.txt | 21 ++++ tools/log_server/CMakeLists.txt | 21 ++++ tools/log_server/Cargo.toml | 16 +-- tools/player/CMakeLists.txt | 22 ++++ tools/player/dll_resolver.cs | 32 +++--- tools/player/player.csproj | 23 ++-- tools/player/toast_engine.cs | 5 + tools/xmake.lua | 84 -------------- vcpkg.json | 12 ++ xmake.lua | 91 --------------- 50 files changed, 671 insertions(+), 424 deletions(-) rename .github/workflows/{branch_rules.yml => branch-rules.yml} (100%) create mode 100644 CMakeLists.txt create mode 100644 cmake/clang_format.cmake create mode 100644 cmake/sync_api_headers.cmake create mode 100644 editor/App.axaml create mode 100644 editor/App.axaml.cs create mode 100644 editor/Assets/avalonia-logo.ico create mode 100644 editor/CMakeLists.txt create mode 100644 editor/Program.cs create mode 100644 editor/ViewLocator.cs create mode 100644 editor/ViewModels/MainWindowViewModel.cs create mode 100644 editor/ViewModels/ViewModelBase.cs create mode 100644 editor/Views/MainWindow.axaml create mode 100644 editor/Views/MainWindow.axaml.cs create mode 100644 editor/app.manifest create mode 100644 editor/editor.csproj delete mode 100644 editor/xmake.lua create mode 100644 engine/CMakeLists.txt rename pch.h => engine/pch.h (100%) delete mode 100644 engine/xmake.lua create mode 100644 tests/CMakeLists.txt create mode 100644 tests/README.md create mode 100644 tests/test_registry.hpp create mode 100644 tests/test_runner.cpp delete mode 100644 tests/xmake.lua create mode 100644 tools/CMakeLists.txt create mode 100644 tools/dummy_game/CMakeLists.txt create mode 100644 tools/kenzo/CMakeLists.txt create mode 100644 tools/log_server/CMakeLists.txt create mode 100644 tools/player/CMakeLists.txt delete mode 100644 tools/xmake.lua create mode 100644 vcpkg.json delete mode 100644 xmake.lua diff --git a/.github/workflows/branch_rules.yml b/.github/workflows/branch-rules.yml similarity index 100% rename from .github/workflows/branch_rules.yml rename to .github/workflows/branch-rules.yml diff --git a/.gitignore b/.gitignore index e948bc731..fea2e9065 100644 --- a/.gitignore +++ b/.gitignore @@ -15,9 +15,10 @@ logs/ **[Oo]bj** **[Tt]arget** engine/include/ +vcpkg_installed/ compile_commands.json -CMakeLists.txt +CMakeUserPresets.json **.sln vsxmake**/ vs**/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..005ca49cd --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 4.0) +project(engine) + +include(CTest) + +set(CMAKE_CXX_STANDARD 23) + +set(OUTPUT_ROOT "${CMAKE_SOURCE_DIR}/out") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_ROOT}") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${OUTPUT_ROOT}") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${OUTPUT_ROOT}") +set(CMAKE_PDB_OUTPUT_DIRECTORY "${OUTPUT_ROOT}") + +foreach(config IN ITEMS Debug Release RelWithDebInfo MinSizeRel) + string(TOUPPER "${config}" config_upper) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${config_upper} "${OUTPUT_ROOT}/${config}") + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${config_upper} "${OUTPUT_ROOT}/${config}") + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${config_upper} "${OUTPUT_ROOT}/${config}") + set(CMAKE_PDB_OUTPUT_DIRECTORY_${config_upper} "${OUTPUT_ROOT}/${config}") +endforeach() + +add_subdirectory(engine) +add_subdirectory(tools) +add_subdirectory(editor) +add_subdirectory(tests) diff --git a/README.md b/README.md index 902d4458d..aea5363d4 100644 --- a/README.md +++ b/README.md @@ -13,17 +13,21 @@ Credits: ## Building Dependencies: -- xmake -- cargo -- dotnet +- cmake 3.25+ +- ninja +- vcpkg (manifest mode) +- cargo (optional, for Rust tools) +- dotnet 10 (optional, for player) +Configure + build with presets (requires `VCPKG_ROOT` set): ``` -xmake run toast.editor +cmake --preset windows-msvc-debug +cmake --build --preset windows-msvc-debug ``` -Generating documentation can be done by simply +Run tests: ``` -xmake documentation +ctest --preset windows-msvc-debug ``` -To use this engine in a project, include it as a submodule and go to Get Started on the documentation \ No newline at end of file +To use this engine in a project, include it as a submodule and go to Get Started on the documentation diff --git a/cmake/clang_format.cmake b/cmake/clang_format.cmake new file mode 100644 index 000000000..8fbe49c1c --- /dev/null +++ b/cmake/clang_format.cmake @@ -0,0 +1,33 @@ +if(NOT DEFINED ROOT_DIR) + message(FATAL_ERROR "clang_format: ROOT_DIR not set") +endif() + +set(SRC_DIR "${ROOT_DIR}/src") +set(FFI_DIR "${ROOT_DIR}/ffi") + +if(NOT IS_DIRECTORY "${SRC_DIR}") + message(STATUS "clang_format: src dir not found: ${SRC_DIR}") + return() +endif() + +find_program(CLANG_FORMAT NAMES clang-format) +if(NOT CLANG_FORMAT) + message(WARNING "clang_format: clang-format not found; skipping formatting") + return() +endif() + +file(GLOB_RECURSE FORMAT_FILES + "${SRC_DIR}/*.h" "${SRC_DIR}/*.hpp" "${SRC_DIR}/*.cpp" + "${FFI_DIR}/*.h" "${FFI_DIR}/*.hpp" "${FFI_DIR}/*.cpp" +) + +foreach(fmt_file IN LISTS FORMAT_FILES) + execute_process( + COMMAND "${CLANG_FORMAT}" -i "${fmt_file}" + RESULT_VARIABLE fmt_result + ) + if(NOT fmt_result EQUAL 0) + message(WARNING "clang_format: clang-format failed for ${fmt_file}") + endif() +endforeach() + diff --git a/cmake/sync_api_headers.cmake b/cmake/sync_api_headers.cmake new file mode 100644 index 000000000..3b802090e --- /dev/null +++ b/cmake/sync_api_headers.cmake @@ -0,0 +1,51 @@ +if(NOT DEFINED ROOT_DIR) + message(FATAL_ERROR "sync_api_headers: ROOT_DIR not set") +endif() + +set(SRC_DIR "${ROOT_DIR}/src") +set(INCLUDE_DIR "${ROOT_DIR}/include") + +set(NOTICE [=[// ============================================================ +// AUTO-GENERATED FILE - DO NOT MODIFY DIRECTLY +// Changes will not persist +// ============================================================]=]) + +if(NOT IS_DIRECTORY "${SRC_DIR}") + message(STATUS "sync_api_headers: src dir not found: ${SRC_DIR}") + return() +endif() + +if(EXISTS "${INCLUDE_DIR}") + file(REMOVE_RECURSE "${INCLUDE_DIR}") +endif() +file(MAKE_DIRECTORY "${INCLUDE_DIR}") + +file(GLOB_RECURSE HEADER_FILES "${SRC_DIR}/*.h" "${SRC_DIR}/*.hpp") +foreach(header IN LISTS HEADER_FILES) + file(READ "${header}" CONTENT) + if(CONTENT MATCHES "TOAST_API") + file(RELATIVE_PATH REL_PATH "${SRC_DIR}" "${header}") + set(dst_path "${INCLUDE_DIR}/${REL_PATH}") + get_filename_component(dst_dir "${dst_path}" DIRECTORY) + file(MAKE_DIRECTORY "${dst_dir}") + file(WRITE "${dst_path}" "${NOTICE}\n${CONTENT}") + + string(REGEX MATCHALL "#include[ \t]+\"([^\"]+\\.inl)\"" INL_MATCHES "${CONTENT}") + if(INL_MATCHES) + get_filename_component(header_dir "${header}" DIRECTORY) + foreach(inl_match IN LISTS INL_MATCHES) + string(REGEX REPLACE "^#include[ \t]+\"([^\"]+\\.inl)\".*" "\\1" inl_rel "${inl_match}") + set(inl_src "${header_dir}/${inl_rel}") + if(EXISTS "${inl_src}") + file(RELATIVE_PATH inl_rel_path "${SRC_DIR}" "${inl_src}") + set(inl_dst "${INCLUDE_DIR}/${inl_rel_path}") + get_filename_component(inl_dst_dir "${inl_dst}" DIRECTORY) + file(MAKE_DIRECTORY "${inl_dst_dir}") + file(READ "${inl_src}" inl_content) + file(WRITE "${inl_dst}" "${NOTICE}\n${inl_content}") + endif() + endforeach() + endif() + endif() +endforeach() + diff --git a/editor/App.axaml b/editor/App.axaml new file mode 100644 index 000000000..dd17fe598 --- /dev/null +++ b/editor/App.axaml @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/editor/App.axaml.cs b/editor/App.axaml.cs new file mode 100644 index 000000000..3333cc406 --- /dev/null +++ b/editor/App.axaml.cs @@ -0,0 +1,31 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Data.Core; +using Avalonia.Data.Core.Plugins; +using System.Linq; +using Avalonia.Markup.Xaml; +using editor.ViewModels; +using editor.Views; + +namespace editor; + +public partial class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = new MainWindow + { + DataContext = new MainWindowViewModel(), + }; + } + + base.OnFrameworkInitializationCompleted(); + } +} \ No newline at end of file diff --git a/editor/Assets/avalonia-logo.ico b/editor/Assets/avalonia-logo.ico new file mode 100644 index 0000000000000000000000000000000000000000..f7da8bb5863b7cecec2adcdebd948fe2f9418d0c GIT binary patch literal 175875 zcmeF42YejG^~X=PahF`_xX^nK-9e_CP!keJsHVDGvWx-KEYm^{B@jA$56Nxcn!sma?^XDWIW5-3ZPp-EGijx>j{t82MBis$#0p0`O zfN#^_bM8%PnUZ`?&o2i~1Yd(7L<^yy>sHVlhPr+f^aVce37j_o{q`>SIXD3P7@P%; z1N(s6fa1&n{eYfd7t95^|2MEX@ad+8r-kwA2>XZeP73dRM)>{ko@mqg4xo2A4@95;Kdwc8 z^!cA~?VtaW^XT)E2R(moc>gg%l`#|jm++gXU(fUaDw{9s%`HL*oxC9f?&&k3Ib<>Skp=)YXf_VZuj&jr5)-w&!Pk~I4^9KA;z{jNF@ zPt<;Q2C7rhmwa|$FQ+qVeIogWJYEZ=XHazs)S2lYO9q{nPS4nHk$+KolIK)I#+sXi>HFyz@Ne6IdCn%ZwxFgpMGDBWr+)j&EWZhEQlqyeCJu@Hd1QN~F{S%Fo`g!`LbEW%zx(fde)MnQQDzmU57!O3Fu7?1%twyj& z`ds_8SK-{ZW5p4D*8|=6aTW=qbw->qU?I@63xL{3qPeXtPYHk1@51e107z}`$vj%8 zRwM+AGqrqA!f5(xgZ?+k^JBoL{Q>9F)&6&d>wqJ`p?{0@k;$kzUeD|6Hwks`Qcpod;W;GbHUjl z7k|`WMfo#{Yo#ryuiFy%vWezTfd8HPP1c*@h_<&QzrV_PwEXIWrT_f%uXDaK@aboj z&*mv+C$3BUvEXpvm$RuS|okt z!*3qTajyR5QxJVV+qv5Oq3Fso!o|{7`mJsCkO-y?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dM^*tZz+KfeXe9L1A$VU=5U5IK_-l zR#^ENCit=Le$l?XGlXLyF!`@f_hq)x,Debug,Release>") + +find_program(DOTNET_EXECUTABLE dotnet REQUIRED) +message(STATUS "Found dotnet: ${DOTNET_EXECUTABLE}") +message(STATUS "Build configuration: ${DOTNET_CONFIG}") +message(STATUS "Output directory: ${OUTPUT_ROOT}/$") + +add_custom_target(editor ALL + COMMAND ${DOTNET_EXECUTABLE} build + "${CSHARP_PROJECT}" + --configuration ${DOTNET_CONFIG} + --output "${OUTPUT_ROOT}/$" + --nologo + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "[dotnet] Building ${CSHARP_ASSEMBLY_NAME} (${DOTNET_CONFIG})..." + VERBATIM +) diff --git a/editor/Program.cs b/editor/Program.cs new file mode 100644 index 000000000..be9371f91 --- /dev/null +++ b/editor/Program.cs @@ -0,0 +1,24 @@ +using Avalonia; +using System; + +namespace editor; + +sealed class Program +{ + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) => BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() +#if DEBUG + .WithDeveloperTools() +#endif + .WithInterFont() + .LogToTrace(); +} diff --git a/editor/ViewLocator.cs b/editor/ViewLocator.cs new file mode 100644 index 000000000..6701c6b86 --- /dev/null +++ b/editor/ViewLocator.cs @@ -0,0 +1,37 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using Avalonia.Controls; +using Avalonia.Controls.Templates; +using editor.ViewModels; + +namespace editor; + +/// +/// Given a view model, returns the corresponding view if possible. +/// +[RequiresUnreferencedCode( + "Default implementation of ViewLocator involves reflection which may be trimmed away.", + Url = "https://docs.avaloniaui.net/docs/concepts/view-locator")] +public class ViewLocator : IDataTemplate +{ + public Control? Build(object? param) + { + if (param is null) + return null; + + var name = param.GetType().FullName!.Replace("ViewModel", "View", StringComparison.Ordinal); + var type = Type.GetType(name); + + if (type != null) + { + return (Control)Activator.CreateInstance(type)!; + } + + return new TextBlock { Text = "Not Found: " + name }; + } + + public bool Match(object? data) + { + return data is ViewModelBase; + } +} diff --git a/editor/ViewModels/MainWindowViewModel.cs b/editor/ViewModels/MainWindowViewModel.cs new file mode 100644 index 000000000..8276a9f83 --- /dev/null +++ b/editor/ViewModels/MainWindowViewModel.cs @@ -0,0 +1,6 @@ +namespace editor.ViewModels; + +public partial class MainWindowViewModel : ViewModelBase +{ + public string Greeting { get; } = "Welcome to Avalonia!"; +} diff --git a/editor/ViewModels/ViewModelBase.cs b/editor/ViewModels/ViewModelBase.cs new file mode 100644 index 000000000..17db38486 --- /dev/null +++ b/editor/ViewModels/ViewModelBase.cs @@ -0,0 +1,7 @@ +using CommunityToolkit.Mvvm.ComponentModel; + +namespace editor.ViewModels; + +public abstract class ViewModelBase : ObservableObject +{ +} diff --git a/editor/Views/MainWindow.axaml b/editor/Views/MainWindow.axaml new file mode 100644 index 000000000..0f83f154b --- /dev/null +++ b/editor/Views/MainWindow.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + diff --git a/editor/Views/MainWindow.axaml.cs b/editor/Views/MainWindow.axaml.cs new file mode 100644 index 000000000..42196da81 --- /dev/null +++ b/editor/Views/MainWindow.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace editor.Views; + +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/editor/app.manifest b/editor/app.manifest new file mode 100644 index 000000000..235e2334e --- /dev/null +++ b/editor/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/editor/editor.csproj b/editor/editor.csproj new file mode 100644 index 000000000..de8f329a7 --- /dev/null +++ b/editor/editor.csproj @@ -0,0 +1,26 @@ + + + WinExe + net10.0 + enable + app.manifest + true + + + + + + + + + + + + + + None + All + + + + diff --git a/editor/xmake.lua b/editor/xmake.lua deleted file mode 100644 index a167fcad7..000000000 --- a/editor/xmake.lua +++ /dev/null @@ -1,31 +0,0 @@ --- Generates a bin path following the default build/p/a/m structure --- local get_path = function() --- local host = get_config("plat") --- local arch = get_config("arch") --- local mode = get_config("mode") --- return path.join("build", host, arch, mode) --- end - --- target("toast.editor", function() --- set_kind("phony") - --- on_build(function(target) --- cprint("${cyan bright}[toast.editor] building...") - --- local args = { --- "publish", --- "editor/editor.csproj", --- "-c", (mode == "debug") and "Debug" or "Release", --- "-o", get_path() --- } --- os.execv("dotnet", args) --- end) - --- on_run(function() --- if is_host("windows") then --- os.exec(path.join(get_path(), "editor.exe")) --- else --- os.exec(path.join(get_path(), "editor")) --- end --- end) --- end) diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt new file mode 100644 index 000000000..3e49c4b5c --- /dev/null +++ b/engine/CMakeLists.txt @@ -0,0 +1,40 @@ +project(toast_engine C CXX) + +find_package(asio CONFIG REQUIRED) +find_package(SDL3 CONFIG REQUIRED) + +file(GLOB_RECURSE SOURCE "src/*.cpp") +add_library(toast_engine SHARED ${SOURCE}) + +target_include_directories(toast_engine + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}/external + ${CMAKE_CURRENT_SOURCE_DIR} + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/ffi +) + +target_link_libraries(toast_engine + PRIVATE + asio::asio + SDL3::SDL3 +) + +target_compile_definitions(toast_engine PRIVATE TOAST_EXPORT) +target_precompile_headers(toast_engine PRIVATE pch.h) + +add_custom_target(clang_format + COMMAND ${CMAKE_COMMAND} -DROOT_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/clang_format.cmake + COMMENT "Formatting sources" + VERBATIM +) + +add_custom_target(sync_api_headers + COMMAND ${CMAKE_COMMAND} -DROOT_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/sync_api_headers.cmake + COMMENT "Syncing public headers" + VERBATIM +) +add_dependencies(sync_api_headers clang_format) +add_dependencies(toast_engine sync_api_headers) diff --git a/pch.h b/engine/pch.h similarity index 100% rename from pch.h rename to engine/pch.h diff --git a/engine/xmake.lua b/engine/xmake.lua deleted file mode 100644 index 89a67c06f..000000000 --- a/engine/xmake.lua +++ /dev/null @@ -1,108 +0,0 @@ ----@diagnostic disable: undefined-field, undefined-global, param-type-mismatch -add_requires("asio 1.36.0") -- networking - -target("toast.engine", function() - set_kind("shared") - add_includedirs(".", "src", "external", { public = false }) - add_includedirs("include", { public = true }) - add_defines("TOAST_EXPORT") - add_rpathdirs("$ORIGIN") - - add_files("**.cpp") - add_headerfiles("src/(**.hpp)", { public = false, extra = { check = true } }) - add_headerfiles("ffi/(**.h)", "include/toast/(**.hpp)", { prefixdir = "toast", extra = { check = true } }) - set_pcxxheader("../pch.h") - - -- External libraries go here -x - add_packages("asio") - if not is_plat("windows") then - add_syslinks("stdc++exp") - end - if is_plat("windows") and (get_config("toolchain") == "mingw" or get_config("toolchain") == "gcc") then - add_syslinks("stdc++exp") - add_defines("__cpp_lib_constexpr_exceptions=0") - on_load(function(target) - local implib = path.join(target:targetdir(), "lib" .. target:name() .. ".dll.a") - target:add("shflags", "-Wl,--out-implib," .. implib, { force = true }) - end) - end - - -- Apply clang-format rule - -- FIX THIS SO CLANG FORMAT ALWAYS RUNS BEFORE THE DANTE HEADERS BULLSHIT - --add_rules("clang-format") - add_rules("sync-headers") - - if is_plat("linux") then - add_syslinks("pthread") - add_shflags("-Wl,--no-as-needed") - elseif is_plat("windows", "mingw") then - add_syslinks("ws2_32", "mswsock") - end -end) - - - - - --- Include Folder Generation -rule("sync-headers") ----@diagnostic disable-next-line: unused-local -before_build(function(target) - import("core.base.option") - - local base_dir = os.scriptdir() - local src_dir = path.join(base_dir, "src") - local dst_dir = path.join(base_dir, "include") - - -- Define the header you want to append - local notice = [[ -// ============================================================ -// AUTO-GENERATED FILE - DO NOT MODIFY DIRECTLY -// Changes will not persist -// ============================================================ -]] - - if not os.isdir(src_dir) then return end - if os.exists(dst_dir) then os.rm(dst_dir) end - os.mkdir(dst_dir) - - local count = 0 - local all_files = table.join(os.files(path.join(src_dir, "**.h")), os.files(path.join(src_dir, "**.hpp"))) - - for _, filepath in ipairs(all_files) do - local content = io.readfile(filepath) - - if content and content:find("TOAST_API", 1, true) then - -- Determine destination path while preserving subfolder structure - local rel_path = path.relative(filepath, src_dir) - local dst_path = path.join(dst_dir, rel_path) - - -- Ensure the subfolder exists in the destination - os.mkdir(path.directory(dst_path)) - - -- Write notice + content to the new file - io.writefile(dst_path, notice .. "\n" .. content) - count = count + 1 - - -- Scan for and copy .inl dependencies - for inl_include in content:gmatch('#include%s+"([^"]+%.inl)"') do - local current_dir = path.directory(filepath) - local inl_src_path = path.join(current_dir, inl_include) - - if os.isfile(inl_src_path) then - local inl_rel_path = path.relative(inl_src_path, src_dir) - local inl_dst_path = path.join(dst_dir, inl_rel_path) - - local inl_content = io.readfile(inl_src_path) - os.mkdir(path.directory(inl_dst_path)) - io.writefile(inl_dst_path, notice .. "\n" .. inl_content) - end - end - end - end - - if count > 0 then - cprint("${green}[sync-headers]: ${reset}Synced API") - end -end) -rule_end() diff --git a/flake.nix b/flake.nix index 8bb16b70d..060e82346 100644 --- a/flake.nix +++ b/flake.nix @@ -21,12 +21,14 @@ { devShells.${system}.default = pkgs.mkShell { nativeBuildInputs = with pkgs; [ - xmake + cmake + ninja gdb valgrind rustup protobuf pkg-config + vcpkg dotnet-sdk clang-tools rust-analyzer diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 000000000..88c47c425 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,36 @@ +include(CTest) + +if (BUILD_TESTING) + file(GLOB_RECURSE TEST_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") + list(REMOVE_ITEM TEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/test_runner.cpp") + + add_executable(toast_tests ${TEST_SOURCES} "${CMAKE_CURRENT_SOURCE_DIR}/test_runner.cpp") + target_include_directories(toast_tests BEFORE PRIVATE ${CMAKE_SOURCE_DIR}/engine/src) + target_include_directories(toast_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries(toast_tests PRIVATE toast_engine) + target_compile_definitions(toast_tests PRIVATE UNIT_TESTING) + + if (NOT WIN32) + target_link_libraries(toast_tests PRIVATE stdc++exp) + elseif (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_link_libraries(toast_tests PRIVATE stdc++exp) + endif() + + foreach(test_src IN LISTS TEST_SOURCES) + file(RELATIVE_PATH relpath "${CMAKE_CURRENT_SOURCE_DIR}" "${test_src}") + string(REPLACE "\\" "/" relpath "${relpath}") + get_filename_component(rel_dir "${relpath}" DIRECTORY) + get_filename_component(test_name "${relpath}" NAME_WE) + + if (NOT rel_dir STREQUAL "") + set(test_case "${rel_dir}/${test_name}") + else() + set(test_case "${test_name}") + endif() + + add_test(NAME ${test_case} COMMAND toast_tests --test ${test_case}) + if (NOT rel_dir STREQUAL "") + set_tests_properties(${test_case} PROPERTIES LABELS "${rel_dir}") + endif() + endforeach() +endif() diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/tests/events/01-basic.cpp b/tests/events/01-basic.cpp index 451e6fb1a..075804c72 100644 --- a/tests/events/01-basic.cpp +++ b/tests/events/01-basic.cpp @@ -1,11 +1,13 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" +#include "test_registry.hpp" + #include struct BasicEvent : event::Event { }; -auto main() -> int { +TOAST_TEST_NAMED("events", "events/01-basic", test_events_01_basic) { event::Listener listener; bool called = false; listener.subscribe([&called](BasicEvent& e) { called = true; }); @@ -14,5 +16,4 @@ auto main() -> int { event::pollEvents(); assert(called); - return 0; } diff --git a/tests/events/02-priority.cpp b/tests/events/02-priority.cpp index 32ecac29a..1f7cb7f3a 100644 --- a/tests/events/02-priority.cpp +++ b/tests/events/02-priority.cpp @@ -1,10 +1,12 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" +#include "test_registry.hpp" + #include #include -auto main() -> int { +TOAST_TEST_NAMED("events", "events/02-priority", test_events_02_priority) { struct PriorityEvent : event::Event { }; event::Listener listener; @@ -23,6 +25,4 @@ auto main() -> int { assert(order[0] == 3); assert(order[1] == 1); assert(order[2] == 2); - - return 0; } diff --git a/tests/events/03-consume.cpp b/tests/events/03-consume.cpp index 035ae67db..cdb16cca8 100644 --- a/tests/events/03-consume.cpp +++ b/tests/events/03-consume.cpp @@ -1,11 +1,13 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" +#include "test_registry.hpp" + #include struct ConsumeEvent : event::Event { }; -auto main() -> int { +TOAST_TEST_NAMED("events", "events/03-consume", test_events_03_consume) { event::Listener listener; bool high_called = false; bool low_called = false; @@ -25,6 +27,4 @@ auto main() -> int { assert(high_called); assert(!low_called); - - return 0; } diff --git a/tests/events/04-named.cpp b/tests/events/04-named.cpp index aae5e707b..c7447af05 100644 --- a/tests/events/04-named.cpp +++ b/tests/events/04-named.cpp @@ -1,12 +1,13 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" +#include "test_registry.hpp" + #include -#include struct NamedEvent : event::Event { }; -auto main() -> int { +TOAST_TEST_NAMED("events", "events/04-named", test_events_04_named) { event::Listener listener; int called = 0; @@ -21,6 +22,4 @@ auto main() -> int { event::send(); event::pollEvents(); assert(called == 1); // Should still be 1 because it's unsubscribed - - return 0; } diff --git a/tests/events/05-arguments.cpp b/tests/events/05-arguments.cpp index de47348e8..5729969e8 100644 --- a/tests/events/05-arguments.cpp +++ b/tests/events/05-arguments.cpp @@ -1,6 +1,8 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" +#include "test_registry.hpp" + #include #include #include @@ -12,7 +14,7 @@ struct ArgEvent : event::Event { ArgEvent(int v, std::string m) : value(v), message(std::move(m)) { } }; -auto main() -> int { +TOAST_TEST_NAMED("events", "events/05-arguments", test_events_05_arguments) { event::Listener listener; int received_value = 0; std::string received_message; @@ -28,6 +30,4 @@ auto main() -> int { assert(received_value == 42); assert(received_message == "hello event"); - - return 0; } diff --git a/tests/events/06-nested.cpp b/tests/events/06-nested.cpp index b1e0eefd2..190814164 100644 --- a/tests/events/06-nested.cpp +++ b/tests/events/06-nested.cpp @@ -1,13 +1,15 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" +#include "test_registry.hpp" + #include struct EventA : event::Event { }; struct EventB : event::Event { }; -auto main() -> int { +TOAST_TEST_NAMED("events", "events/06-nested", test_events_06_nested) { event::Listener listener; bool b_called = false; @@ -21,6 +23,4 @@ auto main() -> int { event::pollEvents(); // Dispatches event_b assert(b_called); - - return 0; } diff --git a/tests/events/07-lifecycle.cpp b/tests/events/07-lifecycle.cpp index b146f4400..a7a155d55 100644 --- a/tests/events/07-lifecycle.cpp +++ b/tests/events/07-lifecycle.cpp @@ -1,11 +1,13 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" +#include "test_registry.hpp" + #include struct LifecycleEvent : event::Event { }; -auto main() -> int { +TOAST_TEST_NAMED("events", "events/07-lifecycle", test_events_07_lifecycle) { int called = 0; { @@ -20,6 +22,4 @@ auto main() -> int { event::send(); event::pollEvents(); assert(called == 1); // should still be 1 if it unsubscribed correctly - - return 0; } diff --git a/tests/events/08-multiple.cpp b/tests/events/08-multiple.cpp index fa0426138..90238e4e7 100644 --- a/tests/events/08-multiple.cpp +++ b/tests/events/08-multiple.cpp @@ -1,13 +1,14 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" +#include "test_registry.hpp" + #include struct EventOne : event::Event { }; - struct EventTwo : event::Event { }; -auto main() -> int { +TOAST_TEST_NAMED("events", "events/08-multiple", test_events_08_multiple) { event::Listener listener_a; event::Listener listener_b; int a_calls = 0; @@ -22,6 +23,4 @@ auto main() -> int { assert(a_calls == 1); assert(b_calls == 1); - - return 0; } diff --git a/tests/events/09-unsubscribe_all.cpp b/tests/events/09-unsubscribe_all.cpp index 490451ed7..839ed434a 100644 --- a/tests/events/09-unsubscribe_all.cpp +++ b/tests/events/09-unsubscribe_all.cpp @@ -1,11 +1,13 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" +#include "test_registry.hpp" + #include struct UnsubEvent : event::Event { }; -auto main() -> int { +TOAST_TEST_NAMED("events", "events/09-unsubscribe_all", test_events_09_unsubscribe_all) { event::Listener listener; int called = 0; @@ -18,6 +20,4 @@ auto main() -> int { event::pollEvents(); assert(called == 0); - - return 0; } diff --git a/tests/events/10-concurrent_send.cpp b/tests/events/10-concurrent_send.cpp index 08f023d0b..abcd30757 100644 --- a/tests/events/10-concurrent_send.cpp +++ b/tests/events/10-concurrent_send.cpp @@ -1,6 +1,8 @@ #include "toast/events/event.hpp" #include "toast/events/listener.hpp" +#include "test_registry.hpp" + #include #include #include @@ -8,7 +10,7 @@ struct CountEvent : event::Event { }; -auto main() -> int { +TOAST_TEST_NAMED("events", "events/10-concurrent_send", test_events_10_concurrent_send) { event::Listener listener; std::atomic counter {0}; @@ -38,6 +40,4 @@ auto main() -> int { event::pollEvents(); assert(counter == num_threads * events_per_thread); - - return 0; } diff --git a/tests/test_registry.hpp b/tests/test_registry.hpp new file mode 100644 index 000000000..0a758d330 --- /dev/null +++ b/tests/test_registry.hpp @@ -0,0 +1,33 @@ +#pragma once + +#include +#include + +namespace toast::tests { + +using TestFn = void (*)(); + +struct TestCase { + std::string name; + std::string group; + TestFn fn; +}; + +inline std::vector& registry() { + static std::vector cases; + return cases; +} + +struct Registrar { + Registrar(const char* name, const char* group, TestFn fn) { + registry().push_back(TestCase{std::string(name), std::string(group), fn}); + } +}; + +} // namespace toast::tests + +#define TOAST_TEST_NAMED(group, name_str, fn_name) \ + static void fn_name(); \ + static const toast::tests::Registrar fn_name##_registrar(name_str, group, &fn_name); \ + static void fn_name() + diff --git a/tests/test_runner.cpp b/tests/test_runner.cpp new file mode 100644 index 000000000..b655cde99 --- /dev/null +++ b/tests/test_runner.cpp @@ -0,0 +1,67 @@ +#include "test_registry.hpp" + +#include +#include +#include + +namespace { + +void print_usage(const char* exe_name) { + std::cout << "Usage: " << exe_name << " [--list] [--test ]" << "\n"; +} + +} // namespace + +int main(int argc, char** argv) { + std::string_view requested_test; + bool list_only = false; + + for (int i = 1; i < argc; ++i) { + std::string_view arg = argv[i]; + if (arg == "--list") { + list_only = true; + } else if (arg == "--test") { + if (i + 1 >= argc) { + print_usage(argv[0]); + return 2; + } + requested_test = argv[++i]; + } else if (arg == "--help" || arg == "-h") { + print_usage(argv[0]); + return 0; + } + } + + const auto& cases = toast::tests::registry(); + if (list_only) { + for (const auto& test_case : cases) { + std::cout << test_case.name << "\n"; + } + return 0; + } + + auto run_case = [](const toast::tests::TestCase& test_case) { + std::cout << "[ RUN ] " << test_case.name << "\n"; + test_case.fn(); + std::cout << "[ OK ] " << test_case.name << "\n"; + }; + + if (!requested_test.empty()) { + auto it = std::find_if(cases.begin(), cases.end(), [&](const auto& test_case) { + return test_case.name == requested_test; + }); + if (it == cases.end()) { + std::cerr << "Unknown test: " << requested_test << "\n"; + return 2; + } + run_case(*it); + return 0; + } + + for (const auto& test_case : cases) { + run_case(test_case); + } + + return 0; +} + diff --git a/tests/xmake.lua b/tests/xmake.lua deleted file mode 100644 index 45dd44da2..000000000 --- a/tests/xmake.lua +++ /dev/null @@ -1,32 +0,0 @@ --- Run Tests: xmake test --- Run Test Group: xmake test -g events - -local scriptdir = os.scriptdir() -for _, filepath in ipairs(os.files(path.join(scriptdir, "**.cpp"))) do - local relpath = path.relative(filepath, scriptdir) - local dir = path.directory(relpath) - local target_name = relpath:gsub("%.cpp$", "") - - target(target_name, function() - set_kind("binary") - set_default(false) - - add_files(filepath) - add_deps("toast.engine") - if not is_plat("windows") then - add_syslinks("stdc++exp") - end - if is_plat("windows") and (get_config("toolchain") == "mingw" or get_config("toolchain") == "gcc") then - add_syslinks("stdc++exp") - end - - add_defines("UNIT_TESTING") - - - -- Grouping logic - set_group("tests/" .. dir) - add_tests("default", { group = dir }) - - add_rpathdirs("./", "../") - end) -end diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt new file mode 100644 index 000000000..a5facfe82 --- /dev/null +++ b/tools/CMakeLists.txt @@ -0,0 +1,4 @@ +add_subdirectory(player) +add_subdirectory(dummy_game) +add_subdirectory(kenzo) +add_subdirectory(log_server) diff --git a/tools/dummy_game/CMakeLists.txt b/tools/dummy_game/CMakeLists.txt new file mode 100644 index 000000000..3a0afb952 --- /dev/null +++ b/tools/dummy_game/CMakeLists.txt @@ -0,0 +1,5 @@ +project(dummy_game CXX) + +add_library(dummy_game SHARED game.cpp) +target_link_libraries(dummy_game PUBLIC toast_engine) +target_compile_definitions(dummy_game PRIVATE GAME_EXPORT) diff --git a/tools/kenzo/CMakeLists.txt b/tools/kenzo/CMakeLists.txt new file mode 100644 index 000000000..a08142f4f --- /dev/null +++ b/tools/kenzo/CMakeLists.txt @@ -0,0 +1,21 @@ +project(kenzo NONE) + +set(CARGO_PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(CARGO_TARGET_DIR "${OUTPUT_ROOT}/$/cargo") +set(CARGO_PROFILE_NAME "$,$,$>,release,debug>") +set(CARGO_PROFILE_FLAG "$,$,$>,release,dev>") + +find_program(CARGO_EXECUTABLE cargo REQUIRED) +message(STATUS "Found cargo: ${CARGO_EXECUTABLE}") +message(STATUS "Build configuration: ${CARGO_PROFILE_NAME}") +message(STATUS "Cargo target directory: ${CARGO_TARGET_DIR}") + +add_custom_target(kenzo ALL + COMMAND ${CARGO_EXECUTABLE} build --profile "${CARGO_PROFILE_FLAG}" --target-dir "${CARGO_TARGET_DIR}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CARGO_TARGET_DIR}/${CARGO_PROFILE_NAME}/kenzo${CMAKE_EXECUTABLE_SUFFIX}" + "${OUTPUT_ROOT}/$/kenzo${CMAKE_EXECUTABLE_SUFFIX}" + WORKING_DIRECTORY ${CARGO_PROJECT_DIR} + COMMENT "[cargo] Building kenzo (${CARGO_PROFILE_NAME})..." + VERBATIM +) diff --git a/tools/log_server/CMakeLists.txt b/tools/log_server/CMakeLists.txt new file mode 100644 index 000000000..9f2d2c2db --- /dev/null +++ b/tools/log_server/CMakeLists.txt @@ -0,0 +1,21 @@ +project(log_server NONE) + +set(CARGO_PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(CARGO_TARGET_DIR "${OUTPUT_ROOT}/$/cargo") +set(CARGO_PROFILE_NAME "$,$,$>,release,debug>") +set(CARGO_PROFILE_FLAG "$,$,$>,release,dev>") + +find_program(CARGO_EXECUTABLE cargo REQUIRED) +message(STATUS "Found cargo: ${CARGO_EXECUTABLE}") +message(STATUS "Build configuration: ${CARGO_PROFILE_NAME}") +message(STATUS "Cargo target directory: ${CARGO_TARGET_DIR}") + +add_custom_target(log_server ALL + COMMAND ${CARGO_EXECUTABLE} build --profile "${CARGO_PROFILE_FLAG}" --target-dir "${CARGO_TARGET_DIR}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CARGO_TARGET_DIR}/${CARGO_PROFILE_NAME}/log_server${CMAKE_EXECUTABLE_SUFFIX}" + "${OUTPUT_ROOT}/$/log_server${CMAKE_EXECUTABLE_SUFFIX}" + WORKING_DIRECTORY ${CARGO_PROJECT_DIR} + COMMENT "[cargo] Building log_server (${CARGO_PROFILE_NAME})..." + VERBATIM +) diff --git a/tools/log_server/Cargo.toml b/tools/log_server/Cargo.toml index 17db8da55..d224327df 100644 --- a/tools/log_server/Cargo.toml +++ b/tools/log_server/Cargo.toml @@ -3,18 +3,14 @@ name = "log_server" version = "0.1.0" edition = "2021" -# This file is for LSP/IDE support only -# The project is built fully with xmake -# Do not use this file for actual compilation - [[bin]] name = "log_server" path = "src/main.rs" [dependencies] -chrono = "0.4" -clap = { version = "4", features = ["derive"] } -csv = "1.3.1" -prost = "0.14" -serde = { version = "1", features = ["derive"] } -tokio = { version = "1", features = ["full"] } +prost = "0.14" +tokio = { version = "1", features = ["full"] } +clap = { version = "4", features = ["derive"] } +csv = "1.3.1" +serde = { version = "1", features = ["derive"] } +chrono = "0.4" \ No newline at end of file diff --git a/tools/player/CMakeLists.txt b/tools/player/CMakeLists.txt new file mode 100644 index 000000000..1b6545556 --- /dev/null +++ b/tools/player/CMakeLists.txt @@ -0,0 +1,22 @@ +project(toast_player NONE) + +set(CSHARP_PROJECT "${CMAKE_CURRENT_SOURCE_DIR}/player.csproj") +set(CSHARP_ASSEMBLY_NAME "player") + +set(DOTNET_CONFIG "$,Debug,Release>") + +find_program(DOTNET_EXECUTABLE dotnet REQUIRED) +message(STATUS "Found dotnet: ${DOTNET_EXECUTABLE}") +message(STATUS "Build configuration: ${DOTNET_CONFIG}") +message(STATUS "Output directory: ${OUTPUT_ROOT}/$") + +add_custom_target(player ALL + COMMAND ${DOTNET_EXECUTABLE} build + "${CSHARP_PROJECT}" + --configuration ${DOTNET_CONFIG} + --output "${OUTPUT_ROOT}/$" + --nologo + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "[dotnet] Building ${CSHARP_ASSEMBLY_NAME} (${DOTNET_CONFIG})..." + VERBATIM +) diff --git a/tools/player/dll_resolver.cs b/tools/player/dll_resolver.cs index d5056d633..aca40a7bb 100644 --- a/tools/player/dll_resolver.cs +++ b/tools/player/dll_resolver.cs @@ -28,16 +28,18 @@ private static IntPtr Resolve(string libraryName, System.Reflection.Assembly ass // System.Console.WriteLine($"[NativeResolver] Resolve called for: {libraryName}"); - // Search roots: assembly location, AppContext.BaseDirectory, current directory + var isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux); + + // Search roots: AppContext.BaseDirectory, assembly location, current directory var roots = new List(); - try { - var asmDir = Path.GetDirectoryName(assembly.Location); - if (!string.IsNullOrEmpty(asmDir)) roots.Add(asmDir); - } catch (Exception ex) { Console.WriteLine($"[NativeResolver] asm location error: {ex.Message}"); } try { var baseDir = AppContext.BaseDirectory; if (!string.IsNullOrEmpty(baseDir)) roots.Add(baseDir); } catch (Exception ex) { Console.WriteLine($"[NativeResolver] baseDir error: {ex.Message}"); } + try { + var asmDir = Path.GetDirectoryName(assembly.Location); + if (!string.IsNullOrEmpty(asmDir)) roots.Add(asmDir); + } catch (Exception ex) { Console.WriteLine($"[NativeResolver] asm location error: {ex.Message}"); } roots.Add(Directory.GetCurrentDirectory()); // System.Console.WriteLine("[NativeResolver] search roots:"); @@ -48,7 +50,7 @@ private static IntPtr Resolve(string libraryName, System.Reflection.Assembly ass : [".so"]; // If resolving the application library, attempt to preload the engine library with RTLD_GLOBAL so DT_NEEDED is resolved - if (libraryName == "__APPLICATION_LIB__") { + if (libraryName == "__APPLICATION_LIB__" && isLinux) { foreach (var ext in extensions) { foreach (var root in roots) { try { @@ -81,15 +83,17 @@ private static IntPtr Resolve(string libraryName, System.Reflection.Assembly ass var oldCwd = Directory.GetCurrentDirectory(); try { if (!string.IsNullOrEmpty(libDir)) Directory.SetCurrentDirectory(libDir); - // Try dlopen directly to ensure DT_NEEDED deps are resolved via RTLD_GLOBAL - const int RTLD_NOW = 2; - const int RTLD_GLOBAL = 0x100; - var handle = dlopen(files[0], RTLD_NOW | RTLD_GLOBAL); - if (handle != IntPtr.Zero) { - // System.Console.WriteLine("[NativeResolver] dlopen(app) succeeded"); - return handle; + if (isLinux) { + // Try dlopen directly to ensure DT_NEEDED deps are resolved via RTLD_GLOBAL + const int RTLD_NOW = 2; + const int RTLD_GLOBAL = 0x100; + var handle = dlopen(files[0], RTLD_NOW | RTLD_GLOBAL); + if (handle != IntPtr.Zero) { + // System.Console.WriteLine("[NativeResolver] dlopen(app) succeeded"); + return handle; + } + // System.Console.WriteLine("[NativeResolver] dlopen(app) returned NULL, falling back to NativeLibrary.Load"); } - // System.Console.WriteLine("[NativeResolver] dlopen(app) returned NULL, falling back to NativeLibrary.Load"); return NativeLibrary.Load(files[0]); } finally { try { Directory.SetCurrentDirectory(oldCwd); } catch { } diff --git a/tools/player/player.csproj b/tools/player/player.csproj index 51e649b9d..007969b6d 100644 --- a/tools/player/player.csproj +++ b/tools/player/player.csproj @@ -1,24 +1,19 @@ - + Exe net10.0 enable enable - player - - - false - - - bin\ - obj\ + nullptr Studios - - - - - + + ../build/debug + + + + ../build/release + diff --git a/tools/player/toast_engine.cs b/tools/player/toast_engine.cs index d6b1da23a..db0116547 100644 --- a/tools/player/toast_engine.cs +++ b/tools/player/toast_engine.cs @@ -11,6 +11,8 @@ public ToastEngine() { m_handle = toast_create(); if (m_handle == IntPtr.Zero) throw new InvalidOperationException("Failed to create engine"); + + //toast_create_SDL_window("Hello from C#!!"); } public void Tick() { @@ -49,4 +51,7 @@ public void Dispose() { [DllImport("__ENGINE_LIB__", CallingConvention = CallingConvention.Cdecl)] private static extern void toast_destroy(IntPtr engine); + + //[DllImport("__ENGINE_LIB__", CallingConvention = CallingConvention.Cdecl)] + //private static extern void toast_create_SDL_window(string windowName); } diff --git a/tools/xmake.lua b/tools/xmake.lua deleted file mode 100644 index d99271756..000000000 --- a/tools/xmake.lua +++ /dev/null @@ -1,84 +0,0 @@ -add_requires("cargo::anyhow 1.0") -add_requires("cargo::chrono 0.4") -add_requires("cargo::clap", { configs = { features = "derive" } }) -add_requires("cargo::csv 1.3.1") -add_requires("cargo::crossterm 0.28.1") -add_requires("cargo::prost 0.14") -add_requires("cargo::prost-types 0.13.5") -add_requires("cargo::serde", { configs = { features = "derive" } }) -add_requires("cargo::textwrap 0.16") -add_requires("cargo::tokio", { configs = { features = "full" } }) -add_requires("cargo::tui-input 0.11") - -local tools_dir = os.scriptdir() - -target("player", function() - set_kind("binary") - set_default(false) - add_deps("toast.engine", "toast.dummy_game") - add_files("player/**.cs") - remove_files("player/obj/**") - set_values("csharp.target_framework", "net10.0") - set_values("csharp.nullable", "enable") - set_values("csharp.implicit_usings", "enable") - set_values("csharp.generate_assembly_info", "false") -end) - -target("toast.dummy_game", function() - set_kind("shared") - set_default(false) - add_files("dummy_game/**.cpp") - add_headerfiles("dummy_game/**.h") - add_deps("toast.engine") - add_defines("GAME_EXPORT") - add_rpathdirs("./") -end) - -target("kenzo", function() - set_kind("binary") - set_default(false) - on_build(function(target) - local oldir = os.cd("$(projectdir)/tools/kenzo") - - if is_mode("release") then - os.execv("cargo", { "build", "--release" }) - else - os.execv("cargo", { "build" }) - end - - -- Copy binary to xmake's output directory so xmake run works - local target_subdir = is_mode("release") and "release" or "debug" - local src_binary = "target/" .. target_subdir .. "/kenzo" - local dst_dir = target:targetdir() - os.mkdir(dst_dir) - os.cp(src_binary, path.join(dst_dir, "kenzo")) - - os.cd(oldir) - end) - on_clean(function(target) - local oldir = os.cd("$(projectdir)/tools/kenzo") - os.execv("cargo", { "clean" }) - os.cd(oldir) - end) -end) - -target("log_server", function() - set_kind("binary") - set_default(false) - -- set_languages("rust") - add_files("log_server/src/main.rs") - add_packages( - "cargo::prost", - "cargo::tokio", - "cargo::clap", - "cargo::csv", - "cargo::serde", - "cargo::chrono" - ) -end) - -target("toast.tools", function() - set_kind("phony") - set_default(false) - add_deps("kenzo", "log_server") -end) diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 000000000..c023aa04f --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,12 @@ +{ + "name" : "engine", + "version-string" : "1.0.0", + "builtin-baseline" : "082b32b6c5de20fd01f61dfaa9856fcba849e73e", + "dependencies" : [ { + "name" : "asio", + "version>=" : "1.32.0" + }, { + "name" : "sdl3", + "version>=" : "3.4.8" + } ] +} \ No newline at end of file diff --git a/xmake.lua b/xmake.lua deleted file mode 100644 index ab33d7587..000000000 --- a/xmake.lua +++ /dev/null @@ -1,91 +0,0 @@ -add_rules("mode.debug", "mode.release") -set_defaultmode("debug") - -set_languages("c++latest") - -rule("clang-format") -before_build(function(target) - cprint("${green}[100%]: ${magenta}<" .. target:name() .. "> ${reset}format") - - local source_files = target:sourcefiles() - for _, file in ipairs(source_files) do - if file:endswith(".cpp") then - os.exec("clang-format -i --style=file:" .. os.curdir() .. "/.clang-format " .. file) - end - end - - local header_files = target:headerfiles() - for _, file in ipairs(header_files) do - if file:endswith(".hpp") or file:endswith(".h") or file:endswith(".inl") then - os.exec("clang-format -i --style=file:" .. os.curdir() .. "/.clang-format " .. file) - end - end -end) -rule_end() - -add_rules("plugin.compile_commands.autoupdate") - - --- Makes release have flto, fast math and SIMD intrinsic optimizations -if is_mode("release") then - set_symbols("hidden") - set_strip("all") - set_optimize("aggressive") - set_policy("build.optimization.lto", true) - add_cxflags("-march=native", "-ffast-math", { force = true, tools = { "clang", "gcc" } }) - add_cxflags("/fp:fast", "/arch:AVX2", { force = true, tools = "cl" }) -end - --- Enables debug optimizations, needed on newer clang and gcc versions to avoid a warning -if is_mode("debug") then - set_optimize("none") - if not is_plat("windows") then - add_cxxflags("-Og") - end - add_defines("DEBUG") -end - -includes("engine/xmake.lua") -includes("editor/xmake.lua") -includes("tools/xmake.lua") -includes("tests/xmake.lua") - -task("tidy") -set_menu { - usage = "xmake tidy", - description = "Run clang-tidy on engine files with progress" -} -on_run(function() - local all_files = os.files("engine/**") - local targets = {} - for _, file in ipairs(all_files) do - local ext = path.extension(file) - local is_valid_ext = (ext == ".hpp" or ext == ".cpp" or ext == ".h" or ext == ".inl") - - -- Skip generated and external folders - if is_valid_ext and - not file:find("engine/generated", 1, true) and - not file:find("engine/external", 1, true) and - not file:find("engine/ffi", 1, true) then - table.insert(targets, file) - end - end - - local total = #targets - if total == 0 then - cprint("${yellow}No files found to analyze.") - return - end - - for i, file in ipairs(targets) do - local percentage = math.floor((i / total) * 100) - local progress = string.format("%3d%%", percentage) - cprint("${green}[" .. progress .. "]: ${reset}clang-tidy.analyzing " .. file) - try { - function() - os.execv("clang-tidy", { "-p", ".", file }) - end - } - end -end) -task_end() From 42e7000dca6ac067ec20e9d7818f562ea9ddac00 Mon Sep 17 00:00:00 2001 From: Xein Date: Tue, 12 May 2026 14:01:23 +0200 Subject: [PATCH 18/21] CI updated --- .github/actions/setup-vcpkg/action.yml | 46 +++ .github/workflows/.gitignore | 8 +- .github/workflows/build-linux-release.yml | 43 -- .github/workflows/build-linux.yml | 44 -- .github/workflows/build-windows-release.yml | 45 -- .github/workflows/build-windows.yml | 46 --- .github/workflows/ci-build-linux.yml | 430 ++++++++++++++++++++ .github/workflows/ci-build-macos.yml | 122 ++++++ .github/workflows/ci-build-windows.yml | 282 +++++++++++++ .github/workflows/clang-format.yml | 27 +- .github/workflows/clang-tidy.yml | 13 +- .github/workflows/test-linux-release.yml | 43 -- .github/workflows/test-linux.yml | 44 -- .github/workflows/test-windows-release.yml | 47 --- .github/workflows/test-windows.yml | 48 --- CMakeLists.txt | 1 + README.md | 8 +- 17 files changed, 921 insertions(+), 376 deletions(-) create mode 100644 .github/actions/setup-vcpkg/action.yml delete mode 100644 .github/workflows/build-linux-release.yml delete mode 100644 .github/workflows/build-linux.yml delete mode 100644 .github/workflows/build-windows-release.yml delete mode 100644 .github/workflows/build-windows.yml create mode 100644 .github/workflows/ci-build-linux.yml create mode 100644 .github/workflows/ci-build-macos.yml create mode 100644 .github/workflows/ci-build-windows.yml delete mode 100644 .github/workflows/test-linux-release.yml delete mode 100644 .github/workflows/test-linux.yml delete mode 100644 .github/workflows/test-windows-release.yml delete mode 100644 .github/workflows/test-windows.yml diff --git a/.github/actions/setup-vcpkg/action.yml b/.github/actions/setup-vcpkg/action.yml new file mode 100644 index 000000000..0917d8caf --- /dev/null +++ b/.github/actions/setup-vcpkg/action.yml @@ -0,0 +1,46 @@ +name: setup-vcpkg + +description: Bootstrap vcpkg and expose the toolchain file path + +outputs: + root: + description: Path to the vcpkg root + value: ${{ steps.vars.outputs.root }} + toolchain-file: + description: Path to the vcpkg CMake toolchain file + value: ${{ steps.vars.outputs.toolchain_file }} + +runs: + using: composite + steps: + - name: Set vcpkg paths + id: vars + shell: bash + run: | + set -euo pipefail + root="${GITHUB_WORKSPACE}/vcpkg" + echo "root=${root}" >> "${GITHUB_OUTPUT}" + echo "toolchain_file=${root}/scripts/buildsystems/vcpkg.cmake" >> "${GITHUB_OUTPUT}" + + - name: Clone vcpkg + shell: bash + run: | + set -euo pipefail + if [[ ! -d "${GITHUB_WORKSPACE}/vcpkg/.git" ]]; then + git clone https://github.com/microsoft/vcpkg "${GITHUB_WORKSPACE}/vcpkg" + fi + + - name: Bootstrap vcpkg (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + $ErrorActionPreference = 'Stop' + & "${env:GITHUB_WORKSPACE}\vcpkg\bootstrap-vcpkg.bat" -disableMetrics + + - name: Bootstrap vcpkg (Unix) + if: runner.os != 'Windows' + shell: bash + run: | + set -euo pipefail + "${GITHUB_WORKSPACE}/vcpkg/bootstrap-vcpkg.sh" -disableMetrics + diff --git a/.github/workflows/.gitignore b/.github/workflows/.gitignore index e63fcbedb..284bc6143 100644 --- a/.github/workflows/.gitignore +++ b/.github/workflows/.gitignore @@ -1,4 +1,4 @@ -!build-linux.yml -!build-linux-release.yml -!build-windows.yml -!build-windows-release.yml \ No newline at end of file +!/ci-build-linux.yml +!/ci-build-macos.yml +!/ci-build-tools-linux.yml +!/ci-build-windows.yml diff --git a/.github/workflows/build-linux-release.yml b/.github/workflows/build-linux-release.yml deleted file mode 100644 index f1f8709c3..000000000 --- a/.github/workflows/build-linux-release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: build-linux-release - -on: - pull_request: - branches: - - main - types: - - opened - - reopened - - synchronize - - edited - -permissions: - contents: read - pull-requests: read - -concurrency: - group: build-linux-release-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - build: - name: build linux release - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Setup Nix - uses: cachix/install-nix-action@v30 - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Build (Linux) - run: | - eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" - xmake f -m release -y - xmake --all -y diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml deleted file mode 100644 index 35d050c24..000000000 --- a/.github/workflows/build-linux.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: build-linux - -on: - pull_request: - branches: - - dev - - main - types: - - opened - - reopened - - synchronize - - edited - -permissions: - contents: read - pull-requests: read - -concurrency: - group: build-linux-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - build: - name: build linux - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Setup Nix - uses: cachix/install-nix-action@v30 - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Build (Linux) - run: | - eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" - xmake f -m debug -y - xmake --all -y diff --git a/.github/workflows/build-windows-release.yml b/.github/workflows/build-windows-release.yml deleted file mode 100644 index 46daa3ae4..000000000 --- a/.github/workflows/build-windows-release.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: build-windows-release - -on: - pull_request: - branches: - - main - types: - - opened - - reopened - - synchronize - - edited - -permissions: - contents: read - pull-requests: read - -concurrency: - group: build-windows-release-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - build: - name: build windows release - runs-on: windows-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Setup xmake - uses: xmake-io/github-action-setup-xmake@v1 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "10.0.x" - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Build (Windows) - run: xmake f -m release -y && xmake --all -y diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml deleted file mode 100644 index dd5b3259c..000000000 --- a/.github/workflows/build-windows.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: build-windows - -on: - pull_request: - branches: - - dev - - main - types: - - opened - - reopened - - synchronize - - edited - -permissions: - contents: read - pull-requests: read - -concurrency: - group: build-windows-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - build: - name: build windows - runs-on: windows-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Setup xmake - uses: xmake-io/github-action-setup-xmake@v1 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "10.0.x" - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Build (Windows) - run: xmake f -m debug -y && xmake --all -y diff --git a/.github/workflows/ci-build-linux.yml b/.github/workflows/ci-build-linux.yml new file mode 100644 index 000000000..85be3d444 --- /dev/null +++ b/.github/workflows/ci-build-linux.yml @@ -0,0 +1,430 @@ +name: ci-build-linux + +on: + pull_request: + branches: + - dev + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: ci-build-linux-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + build-linux-gcc-debug: + name: build linux gcc debug + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build (Linux GCC Debug) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-gcc-debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-gcc-debug + + build-linux-gcc-release: + name: build linux gcc release + needs: build-linux-gcc-debug + if: github.base_ref == 'main' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build (Linux GCC Release) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-gcc-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-gcc-release + + build-linux-clang-debug: + name: build linux clang debug + needs: build-linux-gcc-debug + if: github.base_ref == 'main' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build (Linux Clang Debug) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-clang-debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-clang-debug + + build-linux-clang-release: + name: build linux clang release + needs: build-linux-gcc-debug + if: github.base_ref == 'main' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build (Linux Clang Release) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-clang-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-clang-release + + test-linux-debug: + name: test linux all tests debug + needs: build-linux-gcc-debug + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Run tests (Linux Debug) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-test-debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-test-debug + ctest --test-dir build/linux-test-debug --verbose + + test-linux-release: + name: test linux all tests release + needs: build-linux-gcc-debug + if: github.base_ref == 'main' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Run tests (Linux Release) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-test-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-test-release + ctest --test-dir build/linux-test-release --verbose + + build-editor-linux-debug: + name: build editor linux debug + needs: build-linux-gcc-debug + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build editor (Linux Debug) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-tools-debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-tools-debug --target editor + + build-editor-linux-release: + name: build editor linux release + needs: build-linux-gcc-debug + if: github.base_ref == 'main' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build editor (Linux Release) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-tools-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-tools-release --target editor + + build-player-linux-debug: + name: build player linux debug + needs: build-linux-gcc-debug + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build player (Linux Debug) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-tools-debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-tools-debug --target player + + build-player-linux-release: + name: build player linux release + needs: build-linux-gcc-debug + if: github.base_ref == 'main' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build player (Linux Release) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-tools-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-tools-release --target player + + build-log_server-linux-debug: + name: build log_server linux debug + needs: build-linux-gcc-debug + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build log_server (Linux Debug) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-tools-debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-tools-debug --target log_server + + build-log_server-linux-release: + name: build log_server linux release + needs: build-linux-gcc-debug + if: github.base_ref == 'main' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build log_server (Linux Release) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-tools-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-tools-release --target log_server + + build-kenzo-linux-debug: + name: build kenzo linux debug + needs: build-linux-gcc-debug + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build kenzo (Linux Debug) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-tools-debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-tools-debug --target kenzo + + build-kenzo-linux-release: + name: build kenzo linux release + needs: build-linux-gcc-debug + if: github.base_ref == 'main' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build kenzo (Linux Release) + run: | + eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" + cmake -B build/linux-tools-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/linux-tools-release --target kenzo + + + + + + + + diff --git a/.github/workflows/ci-build-macos.yml b/.github/workflows/ci-build-macos.yml new file mode 100644 index 000000000..084a666f8 --- /dev/null +++ b/.github/workflows/ci-build-macos.yml @@ -0,0 +1,122 @@ +name: ci-build-macos + +on: + pull_request: + branches: + - dev + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: ci-build-macos-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + build-macos-clang-debug: + name: build macos clang debug + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build (macOS Clang Debug) + run: | + cmake -B build/macos-clang-debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/macos-clang-debug + + build-macos-clang-release: + name: build macos clang release + needs: build-macos-clang-debug + if: github.base_ref == 'main' + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build (macOS Clang Release) + run: | + cmake -B build/macos-clang-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/macos-clang-release + + test-macos-debug: + name: test macos all tests debug + needs: build-macos-clang-debug + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Run tests (macOS Debug) + run: | + cmake -B build/macos-test-debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/macos-test-debug + ctest --test-dir build/macos-test-debug --verbose + + test-macos-release: + name: test macos all tests release + needs: build-macos-clang-debug + if: github.base_ref == 'main' + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Run tests (macOS Release) + run: | + cmake -B build/macos-test-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cmake --build build/macos-test-release + ctest --test-dir build/macos-test-release --verbose + + diff --git a/.github/workflows/ci-build-windows.yml b/.github/workflows/ci-build-windows.yml new file mode 100644 index 000000000..8d24bcdc8 --- /dev/null +++ b/.github/workflows/ci-build-windows.yml @@ -0,0 +1,282 @@ +name: ci-build-windows + +on: + pull_request: + branches: + - dev + - main + types: + - opened + - reopened + - synchronize + - edited + +permissions: + contents: read + pull-requests: read + +concurrency: + group: ci-build-windows-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + build-windows-msvc-debug: + name: build windows msvc debug + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build (Windows MSVC Debug) + run: | + cmake -B build/windows-msvc-debug -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-msvc-debug --config Debug + + build-windows-msvc-release: + name: build windows msvc release + needs: build-windows-msvc-debug + if: github.base_ref == 'main' + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Build (Windows MSVC Release) + run: | + cmake -B build/windows-msvc-release -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-msvc-release --config Release + + build-windows-gcc-debug: + name: build windows gcc debug + needs: build-windows-msvc-debug + if: github.base_ref == 'main' + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Setup MinGW + uses: egor-tensin/setup-mingw@v2 + + - name: Build (Windows GCC Debug) + run: | + cmake -B build/windows-gcc-debug -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic + cmake --build build/windows-gcc-debug + + build-windows-gcc-release: + name: build windows gcc release + needs: build-windows-msvc-debug + if: github.base_ref == 'main' + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Setup MinGW + uses: egor-tensin/setup-mingw@v2 + + - name: Build (Windows GCC Release) + run: | + cmake -B build/windows-gcc-release -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic + cmake --build build/windows-gcc-release + + build-windows-clang-debug: + name: build windows clang debug + needs: build-windows-msvc-debug + if: github.base_ref == 'main' + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Setup Clang + uses: egor-tensin/setup-clang@v1 + + - name: Build (Windows Clang Debug) + run: | + cmake -B build/windows-clang-debug -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-clang-debug --config Debug + + build-windows-clang-release: + name: build windows clang release + needs: build-windows-msvc-debug + if: github.base_ref == 'main' + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Setup Clang + uses: egor-tensin/setup-clang@v1 + + - name: Build (Windows Clang Release) + run: | + cmake -B build/windows-clang-release -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-clang-release --config Release + + test-windows-debug: + name: test windows all tests debug + needs: build-windows-msvc-debug + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup .NET 10 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Run tests (Windows Debug) + run: | + cmake -B build/windows-test-debug -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-test-debug --config Debug + ctest --build-config Debug --test-dir build/windows-test-debug --verbose + + test-windows-release: + name: test windows all tests release + needs: build-windows-msvc-debug + if: github.base_ref == 'main' + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Setup .NET 10 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + + - name: Run tests (Windows Release) + run: | + cmake -B build/windows-test-release -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-test-release --config Release + ctest --build-config Release --test-dir build/windows-test-release --verbose + + + + + + + + + + diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 0ffbdfb08..42ad9df7d 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,4 +1,4 @@ -name: clang-format +name: ci-clang-format on: pull_request: @@ -16,7 +16,7 @@ permissions: pull-requests: read concurrency: - group: clang-format-${{ github.event.pull_request.number }} + group: ci-clang-format-${{ github.event.pull_request.number }} cancel-in-progress: true jobs: @@ -34,7 +34,26 @@ jobs: - name: Install Nix uses: cachix/install-nix-action@v30 - - name: Run clang-format + - name: Run clang-format on engine/src and engine/ffi run: | eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" - bash ./tools/ci/clang_format.sh + + mapfile -t files < <(find engine/src engine/ffi \ + -type f \( -name "*.cpp" -o -name "*.hpp" -o -name "*.h" -o -name "*.inl" \) -print | sort) + + if [[ ${#files[@]} -eq 0 ]]; then + echo "No engine files matched formatting filters." + exit 0 + fi + + for file in "${files[@]}"; do + clang-format -i --style=file:.clang-format "$file" + done + + if git diff --quiet -- "${files[@]}"; then + echo "Formatting check passed." + exit 0 + fi + + echo "::error::Formatting changes detected. Run clang-format locally and push the results." + exit 1 diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 36e27be8d..d8fee9e62 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -1,4 +1,4 @@ -name: clang-tidy +name: ci-clang-tidy on: pull_request: @@ -16,7 +16,7 @@ permissions: pull-requests: read concurrency: - group: clang-tidy-${{ github.event.pull_request.number }} + group: ci-clang-tidy-${{ github.event.pull_request.number }} cancel-in-progress: true jobs: @@ -34,12 +34,17 @@ jobs: - name: Install Nix uses: cachix/install-nix-action@v30 + - name: Setup vcpkg + id: vcpkg + uses: ./.github/actions/setup-vcpkg + - name: Generate compile_commands run: | eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" - xmake project -k compile_commands -y + cmake -B build/clang-tidy -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" + cp build/clang-tidy/compile_commands.json . - - name: Run clang-tidy + - name: Run clang-tidy on engine/src run: | eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" bash ./tools/ci/clang_tidy.sh diff --git a/.github/workflows/test-linux-release.yml b/.github/workflows/test-linux-release.yml deleted file mode 100644 index f6ec14525..000000000 --- a/.github/workflows/test-linux-release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: test-linux-release - -on: - pull_request: - branches: - - main - types: - - opened - - reopened - - synchronize - - edited - -permissions: - contents: read - pull-requests: read - -concurrency: - group: test-linux-release-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - test: - name: test linux release - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Install Nix - uses: cachix/install-nix-action@v30 - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Run tests (Linux) - run: | - eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" - xmake f -m release -y - xmake test -y diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml deleted file mode 100644 index b6b332e27..000000000 --- a/.github/workflows/test-linux.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: test-linux - -on: - pull_request: - branches: - - dev - - main - types: - - opened - - reopened - - synchronize - - edited - -permissions: - contents: read - pull-requests: read - -concurrency: - group: test-linux-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - test: - name: test linux - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Install Nix - uses: cachix/install-nix-action@v30 - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Run tests (Linux) - run: | - eval "$(nix --extra-experimental-features 'nix-command flakes' print-dev-env .)" - xmake f -m debug -y - xmake test -y diff --git a/.github/workflows/test-windows-release.yml b/.github/workflows/test-windows-release.yml deleted file mode 100644 index 0211882cf..000000000 --- a/.github/workflows/test-windows-release.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: test-windows-release - -on: - pull_request: - branches: - - main - types: - - opened - - reopened - - synchronize - - edited - -permissions: - contents: read - pull-requests: read - -concurrency: - group: test-windows-release-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - test: - name: test windows release - runs-on: windows-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Setup xmake - uses: xmake-io/github-action-setup-xmake@v1 - - - name: Setup .NET 10 - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "10.0.x" - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Run tests (Windows) - run: | - xmake f -m release -y - xmake test -y diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml deleted file mode 100644 index 8e801f5bd..000000000 --- a/.github/workflows/test-windows.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: test-windows - -on: - pull_request: - branches: - - dev - - main - types: - - opened - - reopened - - synchronize - - edited - -permissions: - contents: read - pull-requests: read - -concurrency: - group: test-windows-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - test: - name: test windows - runs-on: windows-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Setup xmake - uses: xmake-io/github-action-setup-xmake@v1 - - - name: Setup .NET 10 - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "10.0.x" - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Run tests (Windows) - run: | - xmake f -m debug -y - xmake test -y diff --git a/CMakeLists.txt b/CMakeLists.txt index 005ca49cd..2df3a349b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(engine) include(CTest) set(CMAKE_CXX_STANDARD 23) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(OUTPUT_ROOT "${CMAKE_SOURCE_DIR}/out") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_ROOT}") diff --git a/README.md b/README.md index aea5363d4..173becc6e 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,15 @@ Dependencies: - cargo (optional, for Rust tools) - dotnet 10 (optional, for player) -Configure + build with presets (requires `VCPKG_ROOT` set): +Configure + build with vcpkg toolchain (CI bootstraps vcpkg automatically): ``` -cmake --preset windows-msvc-debug -cmake --build --preset windows-msvc-debug +cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake +cmake --build build ``` Run tests: ``` -ctest --preset windows-msvc-debug +ctest --test-dir build ``` To use this engine in a project, include it as a submodule and go to Get Started on the documentation From 2ebedfcfae89bee91ba3ff680ba11e0fed21775a Mon Sep 17 00:00:00 2001 From: Xein Date: Tue, 12 May 2026 14:36:11 +0200 Subject: [PATCH 19/21] Changed jthread to thread for macOS support --- engine/src/toast/thread_pool.cpp | 12 ++++++++++-- engine/src/toast/thread_pool.hpp | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/engine/src/toast/thread_pool.cpp b/engine/src/toast/thread_pool.cpp index 28ac0e95c..f5a893911 100644 --- a/engine/src/toast/thread_pool.cpp +++ b/engine/src/toast/thread_pool.cpp @@ -1,5 +1,7 @@ #include "thread_pool.hpp" +#include "log.hpp" + namespace toast { ThreadPool::ThreadPool(size_t size) { @@ -13,7 +15,7 @@ ThreadPool::ThreadPool(size_t size) { for (size_t i = 0; i < target_thread_num; ++i) { m.workers.emplace_back(&ThreadPool::threadLoop, this); } - // TODO: TOAST_TRACE("Created thread pool with {0} workers", target_thread_num); + TOAST_INFO("ThreadPool", "Created thread pool with {0} workers", target_thread_num); } void ThreadPool::queueJob(std::function&& job) { @@ -34,8 +36,14 @@ void ThreadPool::destroy() { } m.job_available.notify_all(); + for (auto& worker : m.workers) { + if (worker.joinable()) { + worker.join(); + } + } + m.workers.clear(); - // TODO: TOAST_TRACE("Destroyed thread pool"); + TOAST_INFO("ThreadPool", "Destroyed thread pool"); } auto ThreadPool::busy() -> bool { diff --git a/engine/src/toast/thread_pool.hpp b/engine/src/toast/thread_pool.hpp index 6bddd1b94..a08e0e760 100644 --- a/engine/src/toast/thread_pool.hpp +++ b/engine/src/toast/thread_pool.hpp @@ -55,7 +55,7 @@ class ThreadPool { std::mutex queue_mutex; ///< Mutex protecting the job queue std::condition_variable job_available; ///< Notified when a job is enqueued or stop is requested std::condition_variable all_done; ///< Notified when activeJobs hits 0 and queue is empty - std::vector workers; ///< Worker threads (auto-join on destruction) + std::vector workers; ///< Worker threads (auto-join on destruction) std::queue> jobs; ///< Pending job queue } m; From 320d5ae0604cfd7cbcc0ae37f5af808960b0e323 Mon Sep 17 00:00:00 2001 From: Xein Date: Tue, 12 May 2026 14:38:59 +0200 Subject: [PATCH 20/21] CI fix --- .github/workflows/ci-build-windows.yml | 54 ++++++++++++++++++-------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-build-windows.yml b/.github/workflows/ci-build-windows.yml index 8d24bcdc8..8ac7f29d6 100644 --- a/.github/workflows/ci-build-windows.yml +++ b/.github/workflows/ci-build-windows.yml @@ -39,14 +39,17 @@ jobs: - name: Setup Rust uses: dtolnay/rust-toolchain@stable + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Setup vcpkg id: vcpkg uses: ./.github/actions/setup-vcpkg - name: Build (Windows MSVC Debug) run: | - cmake -B build/windows-msvc-debug -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows - cmake --build build/windows-msvc-debug --config Debug + cmake -B build/windows-msvc-debug -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-msvc-debug build-windows-msvc-release: name: build windows msvc release @@ -69,14 +72,17 @@ jobs: - name: Setup Rust uses: dtolnay/rust-toolchain@stable + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Setup vcpkg id: vcpkg uses: ./.github/actions/setup-vcpkg - name: Build (Windows MSVC Release) run: | - cmake -B build/windows-msvc-release -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows - cmake --build build/windows-msvc-release --config Release + cmake -B build/windows-msvc-release -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-msvc-release build-windows-gcc-debug: name: build windows gcc debug @@ -99,6 +105,9 @@ jobs: - name: Setup Rust uses: dtolnay/rust-toolchain@stable + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Setup vcpkg id: vcpkg uses: ./.github/actions/setup-vcpkg @@ -108,7 +117,7 @@ jobs: - name: Build (Windows GCC Debug) run: | - cmake -B build/windows-gcc-debug -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic + cmake -B build/windows-gcc-debug -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic cmake --build build/windows-gcc-debug build-windows-gcc-release: @@ -141,7 +150,7 @@ jobs: - name: Build (Windows GCC Release) run: | - cmake -B build/windows-gcc-release -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic + cmake -B build/windows-gcc-release -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic cmake --build build/windows-gcc-release build-windows-clang-debug: @@ -165,6 +174,9 @@ jobs: - name: Setup Rust uses: dtolnay/rust-toolchain@stable + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Setup vcpkg id: vcpkg uses: ./.github/actions/setup-vcpkg @@ -174,8 +186,8 @@ jobs: - name: Build (Windows Clang Debug) run: | - cmake -B build/windows-clang-debug -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows - cmake --build build/windows-clang-debug --config Debug + cmake -B build/windows-clang-debug -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-clang-debug build-windows-clang-release: name: build windows clang release @@ -198,6 +210,9 @@ jobs: - name: Setup Rust uses: dtolnay/rust-toolchain@stable + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Setup vcpkg id: vcpkg uses: ./.github/actions/setup-vcpkg @@ -207,8 +222,8 @@ jobs: - name: Build (Windows Clang Release) run: | - cmake -B build/windows-clang-release -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows - cmake --build build/windows-clang-release --config Release + cmake -B build/windows-clang-release -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-clang-release test-windows-debug: name: test windows all tests debug @@ -230,15 +245,18 @@ jobs: - name: Setup Rust uses: dtolnay/rust-toolchain@stable + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Setup vcpkg id: vcpkg uses: ./.github/actions/setup-vcpkg - name: Run tests (Windows Debug) run: | - cmake -B build/windows-test-debug -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows - cmake --build build/windows-test-debug --config Debug - ctest --build-config Debug --test-dir build/windows-test-debug --verbose + cmake -B build/windows-test-debug -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-test-debug + ctest --test-dir build/windows-test-debug --verbose test-windows-release: name: test windows all tests release @@ -261,15 +279,19 @@ jobs: - name: Setup Rust uses: dtolnay/rust-toolchain@stable + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Setup vcpkg id: vcpkg uses: ./.github/actions/setup-vcpkg - name: Run tests (Windows Release) run: | - cmake -B build/windows-test-release -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows - cmake --build build/windows-test-release --config Release - ctest --build-config Release --test-dir build/windows-test-release --verbose + cmake -B build/windows-test-release -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" -DVCPKG_TARGET_TRIPLET=x64-windows + cmake --build build/windows-test-release + ctest --test-dir build/windows-test-release --verbose + From 6121050ca2b66da9cd5d84a41947cd6ecf162dec Mon Sep 17 00:00:00 2001 From: Xein Date: Tue, 12 May 2026 14:50:53 +0200 Subject: [PATCH 21/21] Fixed some issues --- engine/src/toast/application.hpp | 5 ++++- engine/src/toast/events/event.hpp | 4 ++-- engine/src/toast/events/event.inl | 2 +- engine/src/toast/thread_pool.hpp | 2 +- tools/dummy_game/CMakeLists.txt | 1 + 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/engine/src/toast/application.hpp b/engine/src/toast/application.hpp index 593b9fc44..8b7480a9b 100644 --- a/engine/src/toast/application.hpp +++ b/engine/src/toast/application.hpp @@ -9,7 +9,10 @@ namespace toast { -class TOAST_API IApplication { +class IApplication { +public: + virtual ~IApplication() = default; + virtual void begin() = 0; virtual void tick() = 0; virtual void destroy() = 0; diff --git a/engine/src/toast/events/event.hpp b/engine/src/toast/events/event.hpp index dab7d467d..ef1eaf3f0 100644 --- a/engine/src/toast/events/event.hpp +++ b/engine/src/toast/events/event.hpp @@ -19,7 +19,7 @@ #include #include #include -#include +// TODO: #include #include #include #include @@ -41,7 +41,7 @@ struct TOAST_API IEvent { virtual ~IEvent() = default; #ifdef DEBUG - std::stacktrace stacktrace; + // std::stacktrace stacktrace; #endif private: diff --git a/engine/src/toast/events/event.inl b/engine/src/toast/events/event.inl index 142a9a55d..e5202fc1c 100644 --- a/engine/src/toast/events/event.inl +++ b/engine/src/toast/events/event.inl @@ -79,7 +79,7 @@ void send(Args&&... args) noexcept { assert(memory); _detail::IEvent* event = new (memory) T(std::forward(args)...); #ifdef DEBUG - event->stacktrace = std::stacktrace::current(1); + // TODO: event->stacktrace = std::stacktrace::current(1); #endif } } diff --git a/engine/src/toast/thread_pool.hpp b/engine/src/toast/thread_pool.hpp index a08e0e760..1c6662326 100644 --- a/engine/src/toast/thread_pool.hpp +++ b/engine/src/toast/thread_pool.hpp @@ -55,7 +55,7 @@ class ThreadPool { std::mutex queue_mutex; ///< Mutex protecting the job queue std::condition_variable job_available; ///< Notified when a job is enqueued or stop is requested std::condition_variable all_done; ///< Notified when activeJobs hits 0 and queue is empty - std::vector workers; ///< Worker threads (auto-join on destruction) + std::vector workers; ///< Worker threads (auto-join on destruction) std::queue> jobs; ///< Pending job queue } m; diff --git a/tools/dummy_game/CMakeLists.txt b/tools/dummy_game/CMakeLists.txt index 3a0afb952..423de9bed 100644 --- a/tools/dummy_game/CMakeLists.txt +++ b/tools/dummy_game/CMakeLists.txt @@ -1,5 +1,6 @@ project(dummy_game CXX) add_library(dummy_game SHARED game.cpp) +add_dependencies(dummy_game toast_engine) target_link_libraries(dummy_game PUBLIC toast_engine) target_compile_definitions(dummy_game PRIVATE GAME_EXPORT)