Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -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: '(_deps|\.pb\.h|\.pb\.cc|/usr/)'
FormatStyle: 'file'
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.25)
project(NeuronIDE CXX)

set(CMAKE_CXX_STANDARD 20)
Expand Down
23 changes: 20 additions & 3 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,43 @@ 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)

# 2. LSL
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)

# 3. Moodycamel ConcurrentQueue
FetchContent_Declare(
concurrentqueue
GIT_REPOSITORY https://github.com/cameron314/concurrentqueue.git
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_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
set(CMAKE_C_FLAGS "${BACKUP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${BACKUP_CXX_FLAGS}")

# 4. SDL2 (System installed)
find_package(SDL2 REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion cmake/StaticAnalysis.cmake
Original file line number Diff line number Diff line change
@@ -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}")
Expand Down
40 changes: 17 additions & 23 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
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)
add_subdirectory(datawriter)

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
datawriter
)

add_executable(NeuronIDE main.cpp)
Expand Down
11 changes: 11 additions & 0 deletions src/datawriter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 7 additions & 0 deletions src/parser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
15 changes: 15 additions & 0 deletions src/renderer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}
)
8 changes: 8 additions & 0 deletions src/scene/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Loading