From fe0ee989e984f13dca1baf2ac3f0c112cb76c4d0 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Mon, 13 Oct 2025 21:32:13 +0200 Subject: [PATCH] Improves build process for internal development Adds an INTERNAL preprocessor definition to manage dependencies. This change allows for a lighter build during internal development by forward declaring some classes and excluding UI and CAN dependencies. --- server/simulator_base.cpp | 2 ++ server/simulator_base.hpp | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/server/simulator_base.cpp b/server/simulator_base.cpp index 7f773e1..984e621 100644 --- a/server/simulator_base.cpp +++ b/server/simulator_base.cpp @@ -1,4 +1,6 @@ +#define INTERNAL #include "simulator_base.hpp" +#include "ui_item.hpp" Simulator_base::Simulator_base(std::string name, Communication *com, std::chrono::milliseconds interval, QObject *parent) diff --git a/server/simulator_base.hpp b/server/simulator_base.hpp index a739157..f027c8e 100644 --- a/server/simulator_base.hpp +++ b/server/simulator_base.hpp @@ -1,12 +1,21 @@ #pragma once -#include "UI.hpp" #include "spdlog/spdlog.h" -#include "ui.hpp" #include #include #include +#ifndef INTERNAL +#include "ui.hpp" +#else +#include + +using json = nlohmann::json; + +Q_FORWARD_DECLARE_OBJC_CLASS(CAN_Wrapper); +Q_FORWARD_DECLARE_OBJC_CLASS(UI_item); +#endif + #define PUSH_UI_ITEM(item) push_ui_item(&item) #define EXPORT_SIM(sim) \ extern "C" Q_DECL_EXPORT Simulator_base *get_sim(Communication *com, QObject *parent) \