Skip to content

Commit

Permalink
add option to build with system sexp library
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Jun 23, 2023
1 parent 5c7d276 commit a7073fc
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ option(ENABLE_COVERAGE "Enable code coverage testing.")
option(ENABLE_SANITIZERS "Enable ASan and other sanitizers.")
option(ENABLE_FUZZERS "Enable fuzz targets.")
option(DOWNLOAD_GTEST "Download Googletest" On)
option(SYSTEM_LIBSEXP "Use system sexp library" OFF)

# crypto components
function(tristate_feature_auto NAME DESCRIPTION)
set(${NAME} Auto CACHE STRING ${DESCRIPTION})
Expand Down Expand Up @@ -182,13 +184,18 @@ 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)
set(SAVE_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF)
add_subdirectory(src/libsexp EXCLUDE_FROM_ALL)
set(BUILD_SHARED_LIBS ${SAVE_BUILD_SHARED_LIBS})
if (SYSTEM_LIBSEXP)
find_package(PkgConfig)
pkg_check_modules(REQUIRED sexp>=0.8.5)
else(SYSTEM_LIBSEXP)
set(WITH_SEXP_CLI OFF)
set(WITH_SEXP_TESTS OFF)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME development)
set(SAVE_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF)
add_subdirectory(src/libsexp EXCLUDE_FROM_ALL)
set(BUILD_SHARED_LIBS ${SAVE_BUILD_SHARED_LIBS})
endif(SYSTEM_LIBSEXP)

add_subdirectory(src/lib)
add_subdirectory(src/rnp)
Expand Down

0 comments on commit a7073fc

Please sign in to comment.