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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- Def: Fixed compilation error in tests with Clang 21. (#6519)
- Dev: Fixed compilation warnings on clang-cl. (#6528)
- Dev: Fixed compilation error in tests with Clang 21. (#6519)
- Dev: Use CMake's `FetchContent` for RapidJSON, PajladaSignals, PajladaSerialize, and PajladaSettings. (#6560)
- Dev: The LuaLS meta files moved from `docs/plugin-meta.lua` to `docs/lua-meta/globals.lua`. (#6530)
- Dev: Compile time definitions for `Windows.h` are now conditional based on `WIN32` instead of `MSVC`. (#6534)
- Dev: Refactored split container nodes to use shared pointers. (#6435)
Expand Down
42 changes: 28 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0087 NEW) # evaluates generator expressions in `install(CODE/SCRIPT)`
cmake_policy(SET CMP0091 NEW) # select MSVC runtime library through `CMAKE_MSVC_RUNTIME_LIBRARY`
include(FeatureSummary)
include(FetchContent)

list(APPEND CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/cmake"
Expand Down Expand Up @@ -195,8 +196,6 @@ if (BUILD_WITH_QTKEYCHAIN)
endif()
endif()

find_package(RapidJSON REQUIRED)

find_package(Websocketpp REQUIRED)

if (BUILD_TESTS)
Expand Down Expand Up @@ -224,23 +223,38 @@ if (BUILD_BENCHMARKS)
find_package(benchmark REQUIRED)
endif ()

find_package(PajladaSerialize REQUIRED)
find_package(PajladaSignals REQUIRED)
FetchContent_Declare(
rapidjson
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/rapidjson
EXCLUDE_FROM_ALL
FIND_PACKAGE_ARGS NAMES RapidJSON
)
set(RAPIDJSON_BUILD_EXAMPLES Off CACHE INTERNAL "")
set(RAPIDJSON_BUILD_TESTS Off CACHE INTERNAL "")

FetchContent_Declare(
PajladaSignals
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/signals
EXCLUDE_FROM_ALL
)
FetchContent_Declare(
PajladaSerialize
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/serialize
EXCLUDE_FROM_ALL
)
FetchContent_Declare(
PajladaSettings
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/settings
EXCLUDE_FROM_ALL
)

FetchContent_MakeAvailable(rapidjson PajladaSignals PajladaSerialize PajladaSettings)

find_package(LRUCache REQUIRED)
find_package(MagicEnum REQUIRED)
find_package(Doxygen)
find_package(BoostCertify REQUIRED)

if (USE_SYSTEM_PAJLADA_SETTINGS)
find_package(PajladaSettings REQUIRED)
else()
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/lib/settings/CMakeLists.txt")
message(FATAL_ERROR "Submodules probably not loaded, unable to find lib/settings/CMakeLists.txt")
endif()

add_subdirectory("${CMAKE_SOURCE_DIR}/lib/settings" EXCLUDE_FROM_ALL)
endif()

if (CHATTERINO_PLUGINS)
set(LUA_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/lib/lua/src")
add_subdirectory(lib/lua)
Expand Down
14 changes: 0 additions & 14 deletions cmake/FindPajladaSerialize.cmake

This file was deleted.

16 changes: 0 additions & 16 deletions cmake/FindPajladaSettings.cmake

This file was deleted.

14 changes: 0 additions & 14 deletions cmake/FindPajladaSignals.cmake

This file was deleted.

14 changes: 0 additions & 14 deletions cmake/FindRapidJSON.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion lib/rapidjson
Submodule rapidjson updated 106 files
14 changes: 11 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,17 @@ if (CHATTERINO_GENERATE_COVERAGE)
)
endif ()

if(TARGET rapidjson)
message(DEBUG "Linking to rapidjson target")
target_link_libraries(${LIBRARY_PROJECT} PUBLIC rapidjson)
elseif(DEFINED RapidJSON_SOURCE_DIR)
message(DEBUG "RapidJSON_SOURCE_DIR defined, assuming this is a submodule/source build. (${RapidJSON_SOURCE_DIR})")
target_include_directories(${LIBRARY_PROJECT} SYSTEM PUBLIC ${RapidJSON_SOURCE_DIR}/include)
else()
message(DEBUG "No rapidjson target found, this is most likely a system install. Adding include directories (${RAPIDJSON_INCLUDE_DIRS}) instead")
target_include_directories(${LIBRARY_PROJECT} SYSTEM PUBLIC ${RAPIDJSON_INCLUDE_DIRS})
endif()

target_link_libraries(${LIBRARY_PROJECT}
PUBLIC
Qt${MAJOR_QT_VERSION}::Core
Expand All @@ -888,7 +899,6 @@ target_link_libraries(${LIBRARY_PROJECT}
Pajlada::Signals
websocketpp::websocketpp
Threads::Threads
RapidJSON::RapidJSON
LRUCache
MagicEnum
$<$<BOOL:${WIN32}>:Wtsapi32>
Expand Down Expand Up @@ -1194,8 +1204,6 @@ target_link_libraries(${LIBRARY_PROJECT}
OpenSSL::Crypto
)

target_include_directories(${LIBRARY_PROJECT} PUBLIC ${RapidJSON_INCLUDE_DIRS})

if (LIBRT)
target_link_libraries(${LIBRARY_PROJECT}
PUBLIC
Expand Down
9 changes: 5 additions & 4 deletions src/common/SignalVectorModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ template <typename T>
struct SignalVectorItemEvent;

template <typename TVectorItem>
class SignalVectorModel : public QAbstractTableModel,
pajlada::Signals::SignalHolder
class SignalVectorModel : public QAbstractTableModel
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: class 'SignalVectorModel' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]

class SignalVectorModel : public QAbstractTableModel
      ^

{
pajlada::Signals::SignalHolder signalHolder;

public:
SignalVectorModel(int columnCount, QObject *parent = nullptr)
: QAbstractTableModel(parent)
Expand Down Expand Up @@ -66,9 +67,9 @@ class SignalVectorModel : public QAbstractTableModel,
insert(args);
}

this->managedConnect(vec->itemInserted, insert);
this->signalHolder.managedConnect(vec->itemInserted, insert);

this->managedConnect(vec->itemRemoved, [this](auto args) {
this->signalHolder.managedConnect(vec->itemRemoved, [this](auto args) {
if (args.caller == this)
{
return;
Expand Down
Loading