Skip to content

Commit

Permalink
removes compile dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
Snider committed Jun 20, 2023
1 parent 316dc84 commit 1e3bef9
Show file tree
Hide file tree
Showing 5 changed files with 603 additions and 2 deletions.
22 changes: 20 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ endif()

cmake_minimum_required(VERSION 2.8.7)


list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")

include(HunterGate)
include(Hunter/HunterCacheServers)
set(HUNTER_CONFIGURATION_TYPES Release CACHE STRING "Build type of Hunter packages")
set(HUNTER_JOBS_NUMBER 6 CACHE STRING "Number of parallel builds used by Hunter")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.24.15.tar.gz"
SHA1 "8010d63d5ae611c564889d5fe12d3cb7a45703ac"
LOCAL
)

project(LetheanVPN)
# shhhhh sleepy time errors, we know...
add_definitions(-w)
Expand Down Expand Up @@ -265,6 +279,7 @@ if (DATABASE STREQUAL "lmdb")
set(BLOCKCHAIN_DB DB_LMDB)
add_definitions("-DDEFAULT_DB_TYPE=\"lmdb\"")
elseif (DATABASE STREQUAL "berkeleydb")
hunter_add_package(BerkeleyDB)
find_package(BerkeleyDB)
if(NOT BERKELEY_DB)
die("Found BerkeleyDB includes, but could not find BerkeleyDB library. Please make sure you have installed libdb and libdb-dev / libdb++-dev or the equivalent.")
Expand Down Expand Up @@ -306,6 +321,7 @@ elseif (ARM AND STATIC)
set(DEFAULT_STACK_TRACE OFF)
set(LIBUNWIND_LIBRARIES "")
else()
hunter_add_package(Libunwind)
find_package(Libunwind)
if(LIBUNWIND_FOUND)
set(DEFAULT_STACK_TRACE ON)
Expand All @@ -332,7 +348,7 @@ if (APPLE AND NOT IOS)
message(STATUS "Using OpenSSL found at ${OPENSSL_ROOT_DIR}")
endif()
endif()

hunter_add_package(OpenSSL)
find_package(OpenSSL REQUIRED)
if(STATIC AND NOT IOS)
if(UNIX)
Expand Down Expand Up @@ -655,6 +671,7 @@ if(STATIC)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
endif()
hunter_add_package(Boost COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale log)
find_package(Boost 1.58 QUIET REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options)

set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_LIB_SUFFIXES})
Expand Down Expand Up @@ -691,7 +708,8 @@ if(BUILD_GUI_DEPS)
endif()

if(USE_READLINE)
find_package(Readline)
hunter_add_package(readline)
find_package(readline)
if(READLINE_FOUND AND GNU_READLINE_FOUND)
add_definitions(-DHAVE_READLINE)
include_directories(${Readline_INCLUDE_DIR})
Expand Down
18 changes: 18 additions & 0 deletions cmake/Hunter/HunterCacheServers-passwords.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Cable: CMake Bootstrap Library.
# Copyright 2018 Pawel Bylica.
# Licensed under the Apache License, Version 2.0. See the LICENSE file.

# Hunter passwords file used by HunterCacheServers.cmake.
# Do not include directly.

hunter_upload_password(
# REPO_OWNER + REPO = https://github.com/letheanVPN/hunter-cache
REPO_OWNER letheanVPN
REPO hunter-cache

# USERNAME = https://github.com/snider
USERNAME snider

# PASSWORD = GitHub token saved as a secure environment variable
PASSWORD "$ENV{HUNTER_CACHE_TOKEN}"
)
27 changes: 27 additions & 0 deletions cmake/Hunter/HunterCacheServers.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Cable: CMake Bootstrap Library.
# Copyright 2018 Pawel Bylica.
# Licensed under the Apache License, Version 2.0. See the LICENSE file.

# This module, when included, sets default values for params related to
# Hunter cache servers, including upload options.

# Default Hunter cache servers.
set(HUNTER_CACHE_SERVERS
"https://github.com/letheanVPN/hunter-cache"
CACHE STRING "Hunter cache servers")

# Default path to Hunter passwords file containing information how to access
# Ethereum's cache server.
set(HUNTER_PASSWORDS_PATH
${CMAKE_CURRENT_LIST_DIR}/HunterCacheServers-passwords.cmake
CACHE STRING "Hunter passwords file")

# In CI builds upload the binaries if the HUNTER_CACHE_TOKEN was decrypted
# (only for branches and internal PRs).
if(NOT "$ENV{HUNTER_CACHE_TOKEN}" STREQUAL "")
set(run_upload YES)
else()
set(run_upload NO)
endif()
option(HUNTER_RUN_UPLOAD "Upload binaries to the Hunter cache server" ${run_upload})
unset(run_upload)
1 change: 1 addition & 0 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hunter_config(Boost VERSION 1.58.0 CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON)
Loading

0 comments on commit 1e3bef9

Please sign in to comment.