From 14cd2ded43df26be58552998dff36ae8c19ea1a1 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sun, 9 Jun 2024 23:33:59 +0200 Subject: [PATCH] build: Add msgpack as git submodule --- .gitmodules | 3 +++ CMakeLists.txt | 1 - cmake/msgpack/CMakeLists.txt | 5 ----- src/blackcore/CMakeLists.txt | 2 +- third_party/CMakeLists.txt | 1 + third_party/cmake/msgpack/CMakeLists.txt | 12 ++++++++++++ third_party/msgpack | 1 + 7 files changed, 18 insertions(+), 7 deletions(-) delete mode 100644 cmake/msgpack/CMakeLists.txt create mode 100644 third_party/cmake/msgpack/CMakeLists.txt create mode 160000 third_party/msgpack diff --git a/.gitmodules b/.gitmodules index 8f1ae8c3a..2e9321b3b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "src/xswiftbus/xplanemp2"] path = src/xswiftbus/xplanemp2 url = git@github.com:swift-project/xplanemp2.git +[submodule "third_party/msgpack"] + path = third_party/msgpack + url = https://github.com/msgpack/msgpack-c.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 42d9b72ee..88a9debb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,7 +143,6 @@ endif() add_subdirectory(cmake/vatsimauth) add_subdirectory(cmake/dbus) add_subdirectory(cmake/sodium) -add_subdirectory(cmake/msgpack) add_subdirectory(cmake/rapidjson) add_subdirectory(cmake/opus) add_subdirectory(cmake/crashpad) diff --git a/cmake/msgpack/CMakeLists.txt b/cmake/msgpack/CMakeLists.txt deleted file mode 100644 index 85a168783..000000000 --- a/cmake/msgpack/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors -# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -add_library(externals_msgpack INTERFACE) -target_include_directories(externals_msgpack INTERFACE ${PROJECT_SOURCE_DIR}/third_party/externals/common/include) diff --git a/src/blackcore/CMakeLists.txt b/src/blackcore/CMakeLists.txt index b99795662..20a938293 100644 --- a/src/blackcore/CMakeLists.txt +++ b/src/blackcore/CMakeLists.txt @@ -255,7 +255,7 @@ target_link_libraries(core input sound externals_sodium - externals_msgpack + msgpack-cxx blackconfig PRIVATE Qt::Qml diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 3c2dbc89f..122731948 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -3,3 +3,4 @@ add_subdirectory(simplecrypt) add_subdirectory(qjsonwebtoken) +add_subdirectory(cmake/msgpack EXCLUDE_FROM_ALL SYSTEM) diff --git a/third_party/cmake/msgpack/CMakeLists.txt b/third_party/cmake/msgpack/CMakeLists.txt new file mode 100644 index 000000000..da500594f --- /dev/null +++ b/third_party/cmake/msgpack/CMakeLists.txt @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +# for simplicity, we are using our own CMake file to provide the msgpack-cxx target + +add_library(msgpack-cxx INTERFACE) + +if(NOT EXISTS ${PROJECT_SOURCE_DIR}/third_party/msgpack/include/) + message(FATAL_ERROR "msgpack not found. Did you forget to initialize the git submodules?") +endif() + +target_include_directories(msgpack-cxx INTERFACE ${PROJECT_SOURCE_DIR}/third_party/msgpack/include) diff --git a/third_party/msgpack b/third_party/msgpack new file mode 160000 index 000000000..29b9505cb --- /dev/null +++ b/third_party/msgpack @@ -0,0 +1 @@ +Subproject commit 29b9505cb76710802e130d5b8403ec1b40de1c8d