Skip to content

Commit

Permalink
firod: add CMake compilation support.
Browse files Browse the repository at this point in the history
    * Improved misc CMake compilation support.
    * Add bitcoin-config.h generation support.
  • Loading branch information
aleflm committed Feb 10, 2025
1 parent 6031191 commit 48ee339
Show file tree
Hide file tree
Showing 9 changed files with 357 additions and 40 deletions.
49 changes: 47 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ endif()
set(CLIENT_NAME "Firo Core")
set(CLIENT_VERSION_MAJOR 0)
set(CLIENT_VERSION_MINOR 14)
set(CLIENT_VERSION_REVISION 14)
set(CLIENT_VERSION_BUILD 0)
set(CLIENT_VERSION_RC 0)
set(CLIENT_VERSION_IS_RELEASE "false")
Expand All @@ -41,7 +42,7 @@ set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
)

project(FiroCore
VERSION ${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_BUILD}
VERSION ${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_REVISION}
DESCRIPTION "Firo client software"
HOMEPAGE_URL "https://firo.org/"
LANGUAGES NONE
Expand Down Expand Up @@ -135,9 +136,14 @@ option(REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting execu
option(WERROR "Treat compiler warnings as errors." OFF)
option(WITH_CCACHE "Attempt to use ccache for compiling." ON)

option(WITH_ZMQ "Enable ZMQ notifications." OFF)
option(WITH_ZMQ "Enable ZMQ notifications." ON)
if(WITH_ZMQ)
message(STATUS "ZMQ notifications enabled.")
add_compile_definitions(ENABLE_ZMQ=1)
find_package(ZeroMQ 4.0.0 MODULE REQUIRED)
else()
message(STATUS "ZMQ notifications disabled.")
add_compile_definitions(ENABLE_ZMQ=0)
endif()

option(WITH_USDT "Enable tracepoints for Userspace, Statically Defined Tracing." OFF)
Expand Down Expand Up @@ -388,6 +394,45 @@ if(BUILD_DAEMON OR BUILD_GUI OR BUILD_CLI OR BUILD_TESTS OR BUILD_BENCH OR BUILD
find_package(Libevent 2.1.8 MODULE REQUIRED)
endif()

# Find bls-dash library
find_library(BLS_DASH_LIBRARY
NAMES bls-dash
REQUIRED
)

if(${BLS_DASH_LIBRARY} STREQUAL "BLS_DASH_LIBRARY-NOTFOUND")
message(FATAL_ERROR "bls-dash library not found")
else()
message(STATUS "Found bls-dash library: ${BLS_DASH_LIBRARY}")
endif()

# Find tor library
find_library(TOR_LIBRARY
NAMES tor
REQUIRED
)

# Find OpenSSL library
find_package(OpenSSL 1.1.1 REQUIRED)

# Find MiniUPNP library
find_library(MINIUPNP_LIBRARY
NAMES miniupnpc
REQUIRED
)

# Find zlib library
find_library(ZLIB_LIBRARY
NAMES z
REQUIRED
)

if(${TOR_LIBRARY} STREQUAL "TOR_LIBRARY-NOTFOUND")
message(FATAL_ERROR "tor library not found")
else()
message(STATUS "Found tor library: ${TOR_LIBRARY}")
endif()

include(cmake/introspection.cmake)
####################
# Check functions and define
Expand Down
11 changes: 7 additions & 4 deletions cmake/bitcoin-build-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
/* Minor version */
#define CLIENT_VERSION_MINOR @CLIENT_VERSION_MINOR@

/* Revision version */
#define CLIENT_VERSION_REVISION @CLIENT_VERSION_REVISION@

/* Copyright holder(s) before %s replacement */
#define COPYRIGHT_HOLDERS "@COPYRIGHT_HOLDERS@"

Expand Down Expand Up @@ -121,16 +124,16 @@
#cmakedefine HAVE_VM_VM_PARAM_H 1

/* Define to the address where bug reports for this package should be sent. */
#define CLIENT_BUGREPORT "@CLIENT_BUGREPORT@"
#define PACKAGE_BUGREPORT "@CLIENT_BUGREPORT@"

/* Define to the full name of this package. */
#define CLIENT_NAME "@CLIENT_NAME@"
#define PACKAGE_NAME "@CLIENT_NAME@"

/* Define to the home page for this package. */
#define CLIENT_URL "@PROJECT_HOMEPAGE_URL@"
#define PACKAGE_URL "@PROJECT_HOMEPAGE_URL@"

/* Define to the version of this package. */
#define CLIENT_VERSION_STRING "@CLIENT_VERSION_STRING@"
#define PACKAGE_VERSION "@CLIENT_VERSION_STRING@"

/* Define to 1 if strerror_r returns char *. */
#cmakedefine STRERROR_R_CHAR_P 1
Expand Down
2 changes: 2 additions & 0 deletions depends/packages/packages.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ qt_mingw32_packages=qt
bdb_packages=bdb
sqlite_packages=sqlite

zmq_packages=zeromq

upnp_packages=miniupnpc

darwin_native_packages = native_ds_store native_mac_alias
Expand Down
2 changes: 1 addition & 1 deletion depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ set(CMAKE_OBJDUMP "@OBJDUMP@")
set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF)

set(CMAKE_FIND_ROOT_PATH "@depends_prefix@")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_FIND_ROOT_PATH}/lib/;${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig")
set(ENV{PKG_CONFIG_PATH} "${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
Expand Down
Loading

0 comments on commit 48ee339

Please sign in to comment.