Blob Blame History Raw
diff -up ./CMakeLists.txt.sexp ./CMakeLists.txt
--- ./CMakeLists.txt.sexp	2023-06-21 13:53:42.637061937 +0200
+++ ./CMakeLists.txt	2023-06-21 13:54:23.450015338 +0200
@@ -58,6 +58,7 @@ option(ENABLE_COVERAGE "Enable code cove
 option(ENABLE_SANITIZERS "Enable ASan and other sanitizers.")
 option(ENABLE_FUZZERS "Enable fuzz targets.")
 option(DOWNLOAD_GTEST "Download Googletest" On)
+option(SYSTEM_LIBSEXPP "Use system sexpp library" OFF)
 option(INSTALL_STATIC_LIBS "Install the static library" On)
 # crypto components
 function(tristate_feature_auto NAME DESCRIPTION)
@@ -177,10 +178,15 @@ if (ENABLE_FUZZERS)
 endif()
 add_subdirectory(src/common)
 
-set(WITH_SEXP_CLI OFF)
-set(WITH_SEXP_TESTS OFF)
-set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME development)
-add_subdirectory(src/libsexp EXCLUDE_FROM_ALL)
+if (SYSTEM_LIBSEXPP)
+  find_package(PkgConfig)
+  pkg_check_modules(REQUIRED sexpp>=0.8.7)
+else()
+  set(WITH_SEXP_CLI OFF)
+  set(WITH_SEXP_TESTS OFF)
+  set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME development)
+  add_subdirectory(src/libsexp EXCLUDE_FROM_ALL)
+endif()
 
 add_subdirectory(src/lib)
 add_subdirectory(src/rnp)
diff -up ./src/librekey/g23_sexp.hpp.old ./src/librekey/g23_sexp.hpp
--- ./src/librekey/g23_sexp.hpp.old	2023-06-26 15:00:38.252931899 +0200
+++ ./src/librekey/g23_sexp.hpp	2023-06-26 15:00:47.831892862 +0200
@@ -27,8 +27,8 @@
 #ifndef RNP_G23_SEXP_HPP
 #define RNP_G23_SEXP_HPP
 
-#include "sexp/sexp.h"
-#include "sexp/ext-key-format.h"
+#include "sexpp/sexp.h"
+#include "sexpp/ext-key-format.h"
 
 #define SXP_MAX_DEPTH 30
 
diff -up ./src/lib/CMakeLists.txt.old ./src/lib/CMakeLists.txt
--- ./src/lib/CMakeLists.txt.old	2023-06-26 15:05:47.529671469 +0200
+++ ./src/lib/CMakeLists.txt	2023-06-26 15:05:50.142660821 +0200
@@ -328,7 +328,7 @@ elseif (CRYPTO_BACKEND_OPENSSL)
   target_link_libraries(librnp-obj PRIVATE OpenSSL::Crypto)
 endif()
 
-target_link_libraries(librnp-obj PRIVATE sexp)
+target_link_libraries(librnp-obj PRIVATE sexpp)
 
 set_target_properties(librnp-obj PROPERTIES CXX_VISIBILITY_PRESET hidden)
 if (TARGET BZip2::BZip2)
@@ -384,7 +384,7 @@ foreach (prop LINK_LIBRARIES INTERFACE_L
   get_target_property(val librnp-obj ${prop})
   if (BUILD_SHARED_LIBS)
     set_property(TARGET librnp-static PROPERTY ${prop} ${val})
-    list(REMOVE_ITEM val "$<LINK_ONLY:sexp>")
+    list(REMOVE_ITEM val "$<LINK_ONLY:sexpp>")
     set_property(TARGET librnp PROPERTY ${prop} ${val})
   else()
     set_property(TARGET librnp PROPERTY ${prop} ${val})
diff -up ./src/tests/CMakeLists.txt.old ./src/tests/CMakeLists.txt
--- ./src/tests/CMakeLists.txt.old	2023-06-26 15:04:32.812975969 +0200
+++ ./src/tests/CMakeLists.txt	2023-06-26 15:04:35.520964931 +0200
@@ -176,7 +176,7 @@ target_link_libraries(rnp_tests
   PRIVATE
     librnp-static
     JSON-C::JSON-C
-    sexp
+    sexpp
     ${GTestMain}
 )
 if (CRYPTO_BACKEND_LOWERCASE STREQUAL "openssl")