Blob Blame History Raw
diff -Naur ddnet-17.4-orig/CMakeLists.txt ddnet-17.4/CMakeLists.txt
--- ddnet-17.4-orig/CMakeLists.txt	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/CMakeLists.txt	2023-12-12 18:46:46.061820017 +0000
@@ -542,6 +542,8 @@
   find_package(SSP)
 endif()
 
+pkg_check_modules(JSONPARSER REQUIRED json-parser)
+
 if(TARGET_OS AND TARGET_OS STREQUAL "mac")
   find_program(CMAKE_OTOOL otool)
   find_program(DMGBUILD dmgbuild)
@@ -623,6 +625,8 @@
   show_dependency_status("Vulkan" VULKAN)
 endif()
 
+show_dependency_status("json-parser" JSONPARSER)
+
 if(NOT(CURL_FOUND))
   message(SEND_ERROR "You must install Curl to compile ${CMAKE_PROJECT_NAME}")
 endif()
@@ -804,19 +808,6 @@
 # DEPENDENCY COMPILATION
 ########################################################################
 
-set_src(DEP_JSON_SRC GLOB src/engine/external/json-parser json.c json.h)
-add_library(json EXCLUDE_FROM_ALL OBJECT ${DEP_JSON_SRC})
-
-set_src(DEP_MD5_SRC GLOB src/engine/external/md5 md5.c md5.h)
-add_library(md5 EXCLUDE_FROM_ALL OBJECT ${DEP_MD5_SRC})
-
-list(APPEND TARGETS_DEP json md5)
-set(DEP_JSON $<TARGET_OBJECTS:json>)
-set(DEP_MD5)
-if(NOT CRYPTO_FOUND)
-  set(DEP_MD5 $<TARGET_OBJECTS:md5>)
-endif()
-
 ########################################################################
 # RUST
 ########################################################################
@@ -2040,13 +2031,14 @@
   src/game/generated/protocol7.h
   src/game/generated/protocolglue.h
 )
-set(DEPS ${DEP_JSON} ${DEP_MD5} ${ZLIB_DEP})
+set(DEPS ${ZLIB_DEP})
 
 # Libraries
 set(LIBS
   ${CRYPTO_LIBRARIES}
   ${CURL_LIBRARIES}
   ${SQLite3_LIBRARIES}
+  ${JSONPARSER_LIBRARIES}
   ${WEBSOCKETS_LIBRARIES}
   ${ZLIB_LIBRARIES}
   ${PLATFORM_LIBS}
diff -Naur ddnet-17.4-orig/src/base/hash_bundled.cpp ddnet-17.4/src/base/hash_bundled.cpp
--- ddnet-17.4-orig/src/base/hash_bundled.cpp	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/src/base/hash_bundled.cpp	2023-12-12 18:47:18.135331264 +0000
@@ -2,7 +2,7 @@
 
 #include "hash_ctxt.h"
 
-#include <engine/external/md5/md5.h>
+#include <md5/md5.h>
 
 void md5_update(MD5_CTX *ctxt, const void *data, size_t data_len)
 {
diff -Naur ddnet-17.4-orig/src/base/hash_ctxt.h ddnet-17.4/src/base/hash_ctxt.h
--- ddnet-17.4-orig/src/base/hash_ctxt.h	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/src/base/hash_ctxt.h	2023-12-12 18:47:38.882114341 +0000
@@ -9,7 +9,7 @@
 #include <openssl/md5.h>
 #include <openssl/sha.h>
 #else
-#include <engine/external/md5/md5.h>
+#include <md5/md5.h>
 #endif
 
 #if defined(CONF_OPENSSL)
diff -Naur ddnet-17.4-orig/src/engine/client/client.cpp ddnet-17.4/src/engine/client/client.cpp
--- ddnet-17.4-orig/src/engine/client/client.cpp	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/src/engine/client/client.cpp	2023-12-12 18:53:47.184313560 +0000
@@ -9,7 +9,7 @@
 #include <base/math.h>
 #include <base/system.h>
 
-#include <engine/external/json-parser/json.h>
+#include <json-parser/json.h>
 
 #include <engine/config.h>
 #include <engine/console.h>
diff -Naur ddnet-17.4-orig/src/engine/client/serverbrowser_http.cpp ddnet-17.4/src/engine/client/serverbrowser_http.cpp
--- ddnet-17.4-orig/src/engine/client/serverbrowser_http.cpp	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/src/engine/client/serverbrowser_http.cpp	2023-12-12 18:51:03.653310364 +0000
@@ -2,7 +2,7 @@
 
 #include <engine/console.h>
 #include <engine/engine.h>
-#include <engine/external/json-parser/json.h>
+#include <json-parser/json.h>
 #include <engine/serverbrowser.h>
 #include <engine/shared/http.h>
 #include <engine/shared/jobs.h>
diff -Naur ddnet-17.4-orig/src/engine/client/updater.cpp ddnet-17.4/src/engine/client/updater.cpp
--- ddnet-17.4-orig/src/engine/client/updater.cpp	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/src/engine/client/updater.cpp	2023-12-12 18:53:47.184313560 +0000
@@ -4,7 +4,7 @@
 
 #include <engine/client.h>
 #include <engine/engine.h>
-#include <engine/external/json-parser/json.h>
+#include <json-parser/json.h>
 #include <engine/shared/http.h>
 #include <engine/shared/json.h>
 #include <engine/storage.h>
diff -Naur ddnet-17.4-orig/src/engine/shared/http.cpp ddnet-17.4/src/engine/shared/http.cpp
--- ddnet-17.4-orig/src/engine/shared/http.cpp	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/src/engine/shared/http.cpp	2023-12-12 18:53:47.174313497 +0000
@@ -3,7 +3,7 @@
 #include <base/log.h>
 #include <base/math.h>
 #include <base/system.h>
-#include <engine/external/json-parser/json.h>
+#include <json-parser/json.h>
 #include <engine/shared/config.h>
 #include <engine/storage.h>
 #include <game/version.h>
diff -Naur ddnet-17.4-orig/src/engine/shared/json.h ddnet-17.4/src/engine/shared/json.h
--- ddnet-17.4-orig/src/engine/shared/json.h	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/src/engine/shared/json.h	2023-12-12 18:53:47.180980206 +0000
@@ -1,7 +1,7 @@
 #ifndef ENGINE_SHARED_JSON_H
 #define ENGINE_SHARED_JSON_H
 
-#include <engine/external/json-parser/json.h>
+#include <json-parser/json.h>
 
 const struct _json_value *json_object_get(const json_value *object, const char *index);
 const struct _json_value *json_array_get(const json_value *array, int index);
diff -Naur ddnet-17.4-orig/src/engine/shared/serverinfo.cpp ddnet-17.4/src/engine/shared/serverinfo.cpp
--- ddnet-17.4-orig/src/engine/shared/serverinfo.cpp	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/src/engine/shared/serverinfo.cpp	2023-12-12 18:53:47.177646852 +0000
@@ -2,7 +2,7 @@
 
 #include "json.h"
 #include <base/math.h>
-#include <engine/external/json-parser/json.h>
+#include <json-parser/json.h>
 
 #include <cstdio>
 
diff -Naur ddnet-17.4-orig/src/game/server/teehistorian.cpp ddnet-17.4/src/game/server/teehistorian.cpp
--- ddnet-17.4-orig/src/game/server/teehistorian.cpp	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/src/game/server/teehistorian.cpp	2023-12-12 18:53:47.167646789 +0000
@@ -1,6 +1,6 @@
 #include "teehistorian.h"
 
-#include <engine/external/json-parser/json.h>
+#include <json-parser/json.h>
 #include <engine/shared/config.h>
 #include <engine/shared/json.h>
 #include <engine/shared/snapshot.h>
diff -Naur ddnet-17.4-orig/src/test/serverinfo.cpp ddnet-17.4/src/test/serverinfo.cpp
--- ddnet-17.4-orig/src/test/serverinfo.cpp	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/src/test/serverinfo.cpp	2023-12-12 18:53:47.174313497 +0000
@@ -3,7 +3,7 @@
 #include <engine/serverbrowser.h>
 #include <engine/shared/serverinfo.h>
 
-#include <engine/external/json-parser/json.h>
+#include <json-parser/json.h>
 
 TEST(ServerInfo, ParseLocation)
 {
diff -Naur ddnet-17.4-orig/src/test/teehistorian.cpp ddnet-17.4/src/test/teehistorian.cpp
--- ddnet-17.4-orig/src/test/teehistorian.cpp	2023-11-15 22:40:08.000000000 +0000
+++ ddnet-17.4/src/test/teehistorian.cpp	2023-12-12 18:53:47.170980143 +0000
@@ -1,7 +1,7 @@
 #include <gtest/gtest.h>
 
 #include <base/detect.h>
-#include <engine/external/json-parser/json.h>
+#include <json-parser/json.h>
 #include <engine/server.h>
 #include <engine/shared/config.h>
 #include <game/gamecore.h>