From 93c89620a122804013c297effc6647f13c61acc1 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 12 Nov 2023 19:16:33 +0000 Subject: [PATCH] cmake: Generate `obj/build.h` header --- src/CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3caa2c2d25e1a2..67c223de8ab923 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,7 +10,23 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) add_subdirectory(crypto) add_subdirectory(univalue) + +add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/src/obj/build.h + COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/src/obj + COMMAND ${PROJECT_SOURCE_DIR}/share/genbuild.sh ${PROJECT_BINARY_DIR}/src/obj/build.h ${PROJECT_SOURCE_DIR} + DEPENDS ${PROJECT_SOURCE_DIR}/share/genbuild.sh + VERBATIM +) +add_custom_target(generate_build_info + DEPENDS ${PROJECT_BINARY_DIR}/src/obj/build.h +) +target_compile_definitions(core INTERFACE + HAVE_BUILD_INFO +) + add_subdirectory(util) +add_dependencies(bitcoin_util generate_build_info) # Stable, backwards-compatible consensus functionality