From 5b8ebb269c8e4045e5d447aa04dd05ed7cb931fb Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 20 Sep 2021 16:16:46 -0400 Subject: [PATCH] changes for liblokinet-ffi * cmake option BUILD_DAEMON for toggling building of daemon directory * when WITH_BOOTSTRAP is OFF dont build curl or cpr --- CMakeLists.txt | 8 +++++--- cmake/StaticBuild.cmake | 2 ++ external/CMakeLists.txt | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 526fbb368..1c41c6e28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,7 @@ option(TRACY_ROOT "include tracy profiler source" OFF) option(WITH_TESTS "build unit tests" OFF) option(WITH_HIVE "build simulation stubs" OFF) option(BUILD_PACKAGE "builds extra components for making an installer (with 'make package')" OFF) +option(BUILD_DAEMON "build lokinet daemon and associated utils" ON) include(cmake/enable_lto.cmake) @@ -182,7 +183,7 @@ if(OXENMQ_FOUND) message(STATUS "Found system liboxenmq ${OXENMQ_VERSION}") else() message(STATUS "using oxenmq submodule") - add_subdirectory(${CMAKE_SOURCE_DIR}/external/oxen-mq) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/oxen-mq) endif() @@ -327,8 +328,9 @@ endif() add_subdirectory(crypto) add_subdirectory(llarp) -add_subdirectory(daemon) - +if(BUILD_DAEMON) + add_subdirectory(daemon) +endif() if(WITH_HIVE) add_subdirectory(pybind) diff --git a/cmake/StaticBuild.cmake b/cmake/StaticBuild.cmake index 87ba00a81..d7546fd02 100644 --- a/cmake/StaticBuild.cmake +++ b/cmake/StaticBuild.cmake @@ -335,6 +335,7 @@ set_target_properties(libzmq PROPERTIES INTERFACE_LINK_LIBRARIES "${libzmq_link_libs}" INTERFACE_COMPILE_DEFINITIONS "ZMQ_STATIC") +if(WITH_BOOTSTRAP) set(curl_extra) if(WIN32) set(curl_ssl_opts --without-ssl --with-schannel) @@ -423,3 +424,4 @@ endif() set_target_properties(CURL::libcurl PROPERTIES INTERFACE_LINK_LIBRARIES "${libcurl_link_libs}" INTERFACE_COMPILE_DEFINITIONS "CURL_STATICLIB") +endif() diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 2ddd0e96f..47ea0b8ab 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -56,7 +56,7 @@ add_ngtcp2_lib() # cpr configuration. Ideally we'd just do this via add_subdirectory, but cpr's cmake requires # 3.15+, and we target lower than that (and this is fairly simple to build). - +if(WITH_BOOTSTRAP) if(NOT BUILD_STATIC_DEPS) find_package(CURL REQUIRED COMPONENTS HTTP HTTPS SSL) @@ -79,3 +79,4 @@ target_link_libraries(cpr PUBLIC CURL::libcurl) target_include_directories(cpr PUBLIC cpr/include) target_compile_definitions(cpr PUBLIC CPR_CURL_NOSIGNAL) add_library(cpr::cpr ALIAS cpr) +endif()