diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -162,6 +162,17 @@ add_subdirectory(secp256k1) 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 # end up with a bunch of libraries without any apparent # cohesive structure. This is inherited from Bitcoin Core @@ -191,13 +202,16 @@ utilstrencodings.cpp utiltime.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 PUBLIC . - # To access the config. + # To access the config/ and obj/ directories ${CMAKE_CURRENT_BINARY_DIR} )