From 228c3a55d36d9f0fd2a06e9260aa8156bdce1647 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 1 Jun 2026 17:04:21 +0200 Subject: [PATCH 1/9] refactor: update Component class * add update() function * store weak_ptr to the owner of the object --- include/scene/components/ComponentRegistry.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/scene/components/ComponentRegistry.hpp b/include/scene/components/ComponentRegistry.hpp index 668dc4a..7b2024a 100644 --- a/include/scene/components/ComponentRegistry.hpp +++ b/include/scene/components/ComponentRegistry.hpp @@ -29,8 +29,12 @@ class ComponentRegistry { void registerCreator(int typeId, ComponentCreatorFunc creator); +<<<<<<< HEAD std::unique_ptr build(const NeuronIDE::Component& protoComp, const std::shared_ptr& owner); +======= + std::unique_ptr build(const NeuronIDE::Component& protoComp, const std::shared_ptr& owner); +>>>>>>> 9d8d705 (refactor: update Component class) private: ComponentRegistry() = default; From 26c94bc52ec1f0f3540a1a49210b0351a0b45fb6 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 1 Jun 2026 17:15:36 +0200 Subject: [PATCH 2/9] fix: format code --- include/scene/components/ComponentRegistry.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/scene/components/ComponentRegistry.hpp b/include/scene/components/ComponentRegistry.hpp index 7b2024a..668dc4a 100644 --- a/include/scene/components/ComponentRegistry.hpp +++ b/include/scene/components/ComponentRegistry.hpp @@ -29,12 +29,8 @@ class ComponentRegistry { void registerCreator(int typeId, ComponentCreatorFunc creator); -<<<<<<< HEAD std::unique_ptr build(const NeuronIDE::Component& protoComp, const std::shared_ptr& owner); -======= - std::unique_ptr build(const NeuronIDE::Component& protoComp, const std::shared_ptr& owner); ->>>>>>> 9d8d705 (refactor: update Component class) private: ComponentRegistry() = default; From 1622a475296ea6279b55afe1098e021ea9c7ab17 Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 3 Jun 2026 16:22:12 +0200 Subject: [PATCH 3/9] refactor: create seperate libraries for scene, renderer and parser --- .clang-tidy | 3 ++- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 2 +- cmake/Dependencies.cmake | 3 +++ cmake/StaticAnalysis.cmake | 2 +- src/CMakeLists.txt | 34 +++++++++++----------------------- src/parser/CMakeLists.txt | 7 +++++++ src/renderer/CMakeLists.txt | 15 +++++++++++++++ src/scene/CMakeLists.txt | 8 ++++++++ 9 files changed, 49 insertions(+), 27 deletions(-) create mode 100644 src/parser/CMakeLists.txt create mode 100644 src/renderer/CMakeLists.txt create mode 100644 src/scene/CMakeLists.txt diff --git a/.clang-tidy b/.clang-tidy index 3def4bd..0842f8d 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,4 +1,5 @@ Checks: 'bugprone-*,cppcoreguidelines-*,performance-*,readability-*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-pro-bounds-array-to-pointer-decay' WarningsAsErrors: '' -HeaderFilterRegex: '^(?!.*\.(pb\.h|pb\.cc)$).*$' +HeaderFilterRegex: '.*' +ExcludeHeaderFilterRegex: '.*\.(pb\.h|pb\.cc)$' FormatStyle: 'file' \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6806370..4f722bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y cmake clang-format clang-tidy libsdl2-dev protobuf-compiler + sudo apt-get install -y cmake clang-format clang-tidy-20 libsdl2-dev protobuf-compiler - name: Check Code Formatting run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index cd61016..23a1575 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.25) project(NeuronIDE CXX) set(CMAKE_CXX_STANDARD 20) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 6ef202c..68a49a9 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -6,6 +6,7 @@ include(FetchContent) FetchContent_Declare( googletest URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip + SYSTEM ) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) FetchContent_MakeAvailable(googletest) @@ -15,6 +16,7 @@ FetchContent_Declare( liblsl GIT_REPOSITORY https://github.com/sccn/liblsl.git GIT_TAG v1.17.7 + SYSTEM ) set(LSL_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) FetchContent_MakeAvailable(liblsl) @@ -24,6 +26,7 @@ FetchContent_Declare( concurrentqueue GIT_REPOSITORY https://github.com/cameron314/concurrentqueue.git GIT_TAG v1.0.4 + SYSTEM ) FetchContent_MakeAvailable(concurrentqueue) diff --git a/cmake/StaticAnalysis.cmake b/cmake/StaticAnalysis.cmake index 21b9b19..9b9d697 100644 --- a/cmake/StaticAnalysis.cmake +++ b/cmake/StaticAnalysis.cmake @@ -1,7 +1,7 @@ # cmake/StaticAnalysis.cmake # --- Clang-Tidy Configuration --- -find_program(CLANG_TIDY_EXE NAMES "clang-tidy") +find_program(CLANG_TIDY_EXE NAMES "clang-tidy-20") if(CLANG_TIDY_EXE) message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 254588a..47c141c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,31 +1,19 @@ protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${CMAKE_CURRENT_SOURCE_DIR}/../protoFiles/neuronide.proto) -add_library(runtime_core OBJECT - Runtime.cpp - parser/Parser.cpp - datawriter/CSVFormatStrategy.cpp - datawriter/DataWriter.cpp - scene/components/ComponentRegistry.cpp - scene/components/BlinkComponent.cpp - scene/SceneObject.cpp - scene/Scene.cpp - renderer/Renderer.cpp - ${PROTO_SRCS} - ${PROTO_HDRS} -) +add_library(neuronide_proto STATIC ${PROTO_SRCS} ${PROTO_HDRS}) +set_target_properties(neuronide_proto PROPERTIES CXX_CLANG_TIDY "") +target_include_directories(neuronide_proto SYSTEM PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries(neuronide_proto PUBLIC protobuf::libprotobuf) -target_include_directories(runtime_core SYSTEM PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/../include - ${CMAKE_CURRENT_BINARY_DIR} - ${SDL2_INCLUDE_DIRS} -) +add_subdirectory(scene) +add_subdirectory(parser) +add_subdirectory(renderer) -target_link_libraries(runtime_core PUBLIC - lsl - concurrentqueue - protobuf::libprotobuf - ${SDL2_LIBRARIES} +add_library(runtime_core STATIC + Runtime.cpp ) +target_include_directories(runtime_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include) +target_link_libraries(runtime_core PUBLIC scene parser renderer) add_executable(NeuronIDE main.cpp) target_link_libraries(NeuronIDE PRIVATE runtime_core) \ No newline at end of file diff --git a/src/parser/CMakeLists.txt b/src/parser/CMakeLists.txt new file mode 100644 index 0000000..f06dab3 --- /dev/null +++ b/src/parser/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(parser OBJECT + Parser.cpp +) + +target_include_directories(parser PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../include/parser) + +target_link_libraries(parser PUBLIC scene) \ No newline at end of file diff --git a/src/renderer/CMakeLists.txt b/src/renderer/CMakeLists.txt new file mode 100644 index 0000000..9f9daec --- /dev/null +++ b/src/renderer/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(renderer OBJECT + Renderer.cpp +) + +target_include_directories(renderer PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/../../include/renderer + ${SDL2_INCLUDE_DIRS} +) + +target_link_libraries(renderer PUBLIC + scene + lsl + concurrentqueue + ${SDL2_LIBRARIES} +) \ No newline at end of file diff --git a/src/scene/CMakeLists.txt b/src/scene/CMakeLists.txt new file mode 100644 index 0000000..1338a40 --- /dev/null +++ b/src/scene/CMakeLists.txt @@ -0,0 +1,8 @@ +add_library(scene OBJECT + SceneObject.cpp + Scene.cpp + components/ComponentRegistry.cpp + components/BlinkComponent.cpp +) +target_include_directories(scene PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../include) +target_link_libraries(scene PUBLIC neuronide_proto) \ No newline at end of file From c964583e4500a56c208186d28480d166c28f6848 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 15 Jun 2026 16:28:23 +0200 Subject: [PATCH 4/9] cmake: turn off compiler warnings for third party libraries --- cmake/Dependencies.cmake | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 68a49a9..4eaf72a 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -9,7 +9,6 @@ FetchContent_Declare( SYSTEM ) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) -FetchContent_MakeAvailable(googletest) # 2. LSL FetchContent_Declare( @@ -19,7 +18,6 @@ FetchContent_Declare( SYSTEM ) set(LSL_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) -FetchContent_MakeAvailable(liblsl) # 3. Moodycamel ConcurrentQueue FetchContent_Declare( @@ -28,7 +26,23 @@ FetchContent_Declare( GIT_TAG v1.0.4 SYSTEM ) -FetchContent_MakeAvailable(concurrentqueue) + +# Suppress compiler warnings from third-party targets when compiling their source files +set(BACKUP_C_FLAGS "${CMAKE_C_FLAGS}") +set(BACKUP_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") +elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") +endif() + +FetchContent_MakeAvailable(googletest liblsl concurrentqueue) + +# Restore compiler flags for our own project code +set(CMAKE_C_FLAGS "${BACKUP_C_FLAGS}") +set(CMAKE_CXX_FLAGS "${BACKUP_CXX_FLAGS}") # 4. SDL2 (System installed) find_package(SDL2 REQUIRED) From 70b3e264ef64ec1b23b64eb5bbe6570b4184f4d2 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 15 Jun 2026 16:34:24 +0200 Subject: [PATCH 5/9] cmake: fix dependencies.cmake --- cmake/Dependencies.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 4eaf72a..8b0b7c8 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -30,10 +30,10 @@ FetchContent_Declare( # Suppress compiler warnings from third-party targets when compiling their source files set(BACKUP_C_FLAGS "${CMAKE_C_FLAGS}") set(BACKUP_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") -elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC") +elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") endif() From 6cb352be69b6a13ee879099368c3e77fa4a945ed Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 17 Jun 2026 20:30:56 +0200 Subject: [PATCH 6/9] refactor: create seperate target for datawriter --- src/CMakeLists.txt | 8 +++++++- src/datawriter/CMakeLists.txt | 11 +++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/datawriter/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 47c141c..9d0e94c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,12 +8,18 @@ target_link_libraries(neuronide_proto PUBLIC protobuf::libprotobuf) add_subdirectory(scene) add_subdirectory(parser) add_subdirectory(renderer) +add_subdirectory(datawriter) add_library(runtime_core STATIC Runtime.cpp ) target_include_directories(runtime_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include) -target_link_libraries(runtime_core PUBLIC scene parser renderer) +target_link_libraries(runtime_core PUBLIC + scene + parser + renderer + datawriter +) add_executable(NeuronIDE main.cpp) target_link_libraries(NeuronIDE PRIVATE runtime_core) \ No newline at end of file diff --git a/src/datawriter/CMakeLists.txt b/src/datawriter/CMakeLists.txt new file mode 100644 index 0000000..c0b9322 --- /dev/null +++ b/src/datawriter/CMakeLists.txt @@ -0,0 +1,11 @@ +add_library(datawriter OBJECT + CSVFormatStrategy.cpp + DataWriter.cpp +) + +target_include_directories(datawriter PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/../../include/datawriter + ${CMAKE_CURRENT_SOURCE_DIR}/../../include/data_structures +) + +target_link_libraries(datawriter PRIVATE concurrentqueue) From d04b2590b46a60d47110c67dacf95fa93d2fde7d Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 17 Jun 2026 22:02:23 +0200 Subject: [PATCH 7/9] style: update .clang-tidy --- .clang-tidy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index 0842f8d..85b5c39 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ Checks: 'bugprone-*,cppcoreguidelines-*,performance-*,readability-*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-pro-bounds-array-to-pointer-decay' WarningsAsErrors: '' HeaderFilterRegex: '.*' -ExcludeHeaderFilterRegex: '.*\.(pb\.h|pb\.cc)$' +ExcludeHeaderFilterRegex: '(_deps|\.pb\.h|\.pb\.cc|/usr/)' FormatStyle: 'file' \ No newline at end of file From 82b31356661cf80bccb06fa496a6caecccae874f Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 17 Jun 2026 22:13:19 +0200 Subject: [PATCH 8/9] refactor: mark lsl dependency as SYSTEM --- cmake/Dependencies.cmake | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 8b0b7c8..6f7de31 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -27,17 +27,6 @@ FetchContent_Declare( SYSTEM ) -# Suppress compiler warnings from third-party targets when compiling their source files -set(BACKUP_C_FLAGS "${CMAKE_C_FLAGS}") -set(BACKUP_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") -elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") -endif() - FetchContent_MakeAvailable(googletest liblsl concurrentqueue) # Restore compiler flags for our own project code From b4a91a67eb0956f22614cf5229a16b7d2f54217e Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 17 Jun 2026 22:20:52 +0200 Subject: [PATCH 9/9] refactor: suppress third party compiler warnings --- cmake/Dependencies.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 6f7de31..8b0b7c8 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -27,6 +27,17 @@ FetchContent_Declare( SYSTEM ) +# Suppress compiler warnings from third-party targets when compiling their source files +set(BACKUP_C_FLAGS "${CMAKE_C_FLAGS}") +set(BACKUP_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") +elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") +endif() + FetchContent_MakeAvailable(googletest liblsl concurrentqueue) # Restore compiler flags for our own project code