Changeset View
Changeset View
Standalone View
Standalone View
src/CMakeLists.txt
Show First 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | |||||
add_subdirectory(config) | add_subdirectory(config) | ||||
# libraries | # libraries | ||||
add_subdirectory(crypto) | add_subdirectory(crypto) | ||||
add_subdirectory(leveldb) | add_subdirectory(leveldb) | ||||
add_subdirectory(secp256k1) | add_subdirectory(secp256k1) | ||||
add_subdirectory(univalue) | add_subdirectory(univalue) | ||||
set(OBJ_DIR "${CMAKE_CURRENT_BINARY_DIR}/obj") | |||||
file(MAKE_DIRECTORY "${OBJ_DIR}") | |||||
set(BUILD_HEADER "${OBJ_DIR}/build.h") | |||||
add_custom_command( | |||||
OUTPUT "${BUILD_HEADER}" | |||||
COMMAND | |||||
"${CMAKE_SOURCE_DIR}/share/genbuild.sh" | |||||
"${BUILD_HEADER}" | |||||
"${CMAKE_SOURCE_DIR}" | |||||
) | |||||
# Because the Bitcoin ABc source code is disorganised, we | # Because the Bitcoin ABc source code is disorganised, we | ||||
# end up with a bunch of libraries without any apparent | # end up with a bunch of libraries without any apparent | ||||
# cohesive structure. This is inherited from Bitcoin Core | # cohesive structure. This is inherited from Bitcoin Core | ||||
# and reflecting this. | # and reflecting this. | ||||
# TODO: Improve the structure once cmake is rocking. | # TODO: Improve the structure once cmake is rocking. | ||||
# Various completely unrelated features shared by all executables. | # Various completely unrelated features shared by all executables. | ||||
add_library(util | add_library(util | ||||
Show All 13 Lines | add_library(util | ||||
sync.cpp | sync.cpp | ||||
threadinterrupt.cpp | threadinterrupt.cpp | ||||
uint256.cpp | uint256.cpp | ||||
util.cpp | util.cpp | ||||
utilmoneystr.cpp | utilmoneystr.cpp | ||||
utilstrencodings.cpp | utilstrencodings.cpp | ||||
utiltime.cpp | utiltime.cpp | ||||
util/bytevectorhash.cpp | util/bytevectorhash.cpp | ||||
# obj/build.h | |||||
${BUILD_HEADER} | |||||
) | ) | ||||
target_compile_definitions(util PUBLIC HAVE_CONFIG_H) | target_compile_definitions(util PUBLIC HAVE_CONFIG_H HAVE_BUILD_INFO) | ||||
target_include_directories(util | target_include_directories(util | ||||
PUBLIC | PUBLIC | ||||
. | . | ||||
# To access the config. | # To access the config/ and obj/ directories | ||||
${CMAKE_CURRENT_BINARY_DIR} | ${CMAKE_CURRENT_BINARY_DIR} | ||||
) | ) | ||||
if(ENABLE_GLIBC_BACK_COMPAT) | if(ENABLE_GLIBC_BACK_COMPAT) | ||||
# glibc absorbed clock_gettime in 2.17. librt (its previous location) is | # glibc absorbed clock_gettime in 2.17. librt (its previous location) is | ||||
# safe to link in anyway for back-compat. | # safe to link in anyway for back-compat. | ||||
find_library(RT_LIBRARY rt) | find_library(RT_LIBRARY rt) | ||||
target_link_libraries(util ${RT_LIBRARY}) | target_link_libraries(util ${RT_LIBRARY}) | ||||
▲ Show 20 Lines • Show All 257 Lines • Show Last 20 Lines |