mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
Merge bitcoin/bitcoin#30856: build: drop obj/ subdirectory for generated build.h
7025942687
build: drop superfluous `HAVE_BUILD_INFO` define (Sebastian Falbesoner)0dd662510c
build: drop obj/ subdir for generated build.h, rename to bitcoin-build-info.h (Sebastian Falbesoner) Pull request description: As indicated by the TODO, the obj subdirectory is not needed anymore now for the generated build.h header, since autotools are gone and we don't have in-source builds anymore (see #30454, #30664). In the second commit the superflous `HAVE_BUILD_INFO` macro is dropped, as suggested in https://github.com/bitcoin/bitcoin/pull/30856#pullrequestreview-2292424496. ACKs for top commit: theuni: utACK7025942687
Tree-SHA512: 0a3b2cbbcf638344ceb74e5ba5a0fe2b1718427b23a18c8890258db36ce7177006a146178ed88d9c5ae956a5426f3844e86c1f4cca7c40946359742bffda983b
This commit is contained in:
commit
197aa24955
2 changed files with 5 additions and 15 deletions
|
@ -8,23 +8,15 @@ include(AddWindowsResources)
|
||||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/bitcoin-config.h.in config/bitcoin-config.h USE_SOURCE_PERMISSIONS @ONLY)
|
configure_file(${PROJECT_SOURCE_DIR}/cmake/bitcoin-config.h.in config/bitcoin-config.h USE_SOURCE_PERMISSIONS @ONLY)
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
# TODO: After the transition from Autotools to CMake, the obj/ subdirectory
|
|
||||||
# could be dropped as its only purpose was to separate a generated header
|
|
||||||
# from source files.
|
|
||||||
add_custom_target(generate_build_info
|
add_custom_target(generate_build_info
|
||||||
BYPRODUCTS ${PROJECT_BINARY_DIR}/src/obj/build.h
|
BYPRODUCTS ${PROJECT_BINARY_DIR}/src/bitcoin-build-info.h
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/src/obj
|
COMMAND ${CMAKE_COMMAND} -DBUILD_INFO_HEADER_PATH=${PROJECT_BINARY_DIR}/src/bitcoin-build-info.h -DSOURCE_DIR=${PROJECT_SOURCE_DIR} -P ${PROJECT_SOURCE_DIR}/cmake/script/GenerateBuildInfo.cmake
|
||||||
COMMAND ${CMAKE_COMMAND} -DBUILD_INFO_HEADER_PATH=${PROJECT_BINARY_DIR}/src/obj/build.h -DSOURCE_DIR=${PROJECT_SOURCE_DIR} -P ${PROJECT_SOURCE_DIR}/cmake/script/GenerateBuildInfo.cmake
|
COMMENT "Generating bitcoin-build-info.h"
|
||||||
COMMENT "Generating obj/build.h"
|
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
add_library(bitcoin_clientversion OBJECT EXCLUDE_FROM_ALL
|
add_library(bitcoin_clientversion OBJECT EXCLUDE_FROM_ALL
|
||||||
clientversion.cpp
|
clientversion.cpp
|
||||||
)
|
)
|
||||||
target_compile_definitions(bitcoin_clientversion
|
|
||||||
PRIVATE
|
|
||||||
HAVE_BUILD_INFO
|
|
||||||
)
|
|
||||||
target_link_libraries(bitcoin_clientversion
|
target_link_libraries(bitcoin_clientversion
|
||||||
PRIVATE
|
PRIVATE
|
||||||
core_interface
|
core_interface
|
||||||
|
|
|
@ -23,14 +23,12 @@ using util::Join;
|
||||||
const std::string CLIENT_NAME("Satoshi");
|
const std::string CLIENT_NAME("Satoshi");
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_BUILD_INFO
|
#include <bitcoin-build-info.h>
|
||||||
#include <obj/build.h>
|
// The <bitcoin-build-info.h>, which is generated by the build environment (cmake/script/GenerateBuildInfo.cmake),
|
||||||
// The <obj/build.h>, which is generated by the build environment (cmake/script/GenerateBuildInfo.cmake),
|
|
||||||
// could contain only one line of the following:
|
// could contain only one line of the following:
|
||||||
// - "#define BUILD_GIT_TAG ...", if the top commit is tagged
|
// - "#define BUILD_GIT_TAG ...", if the top commit is tagged
|
||||||
// - "#define BUILD_GIT_COMMIT ...", if the top commit is not tagged
|
// - "#define BUILD_GIT_COMMIT ...", if the top commit is not tagged
|
||||||
// - "// No build information available", if proper git information is not available
|
// - "// No build information available", if proper git information is not available
|
||||||
#endif
|
|
||||||
|
|
||||||
//! git will put "#define GIT_COMMIT_ID ..." on the next line inside archives. $Format:%n#define GIT_COMMIT_ID "%H"$
|
//! git will put "#define GIT_COMMIT_ID ..." on the next line inside archives. $Format:%n#define GIT_COMMIT_ID "%H"$
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue