mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-07 10:27:47 -05:00
build: simplify dependency graph
Allow the objects of static libs to be built in parallel rather than serially based on their dependency ordering. For more detail, see: https://cmake.org/cmake/help/latest/prop_tgt/OPTIMIZE_DEPENDENCIES.html
This commit is contained in:
parent
c4e498300c
commit
12fa9511b5
3 changed files with 13 additions and 0 deletions
|
@ -71,6 +71,13 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
|||
|
||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/module)
|
||||
|
||||
# Flatten static lib dependencies.
|
||||
# Without this, if libfoo.a depends on libbar.a, libfoo's objects can't begin
|
||||
# to be compiled until libbar.a has been created.
|
||||
if (NOT DEFINED CMAKE_OPTIMIZE_DEPENDENCIES)
|
||||
set(CMAKE_OPTIMIZE_DEPENDENCIES TRUE)
|
||||
endif()
|
||||
|
||||
#=============================
|
||||
# Configurable options
|
||||
#=============================
|
||||
|
|
|
@ -74,6 +74,9 @@ add_library(minisketch STATIC EXCLUDE_FROM_ALL
|
|||
${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/generic_8bytes.cpp
|
||||
)
|
||||
|
||||
# Workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/24058
|
||||
set_target_properties(minisketch PROPERTIES OPTIMIZE_DEPENDENCIES OFF)
|
||||
|
||||
target_include_directories(minisketch
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/minisketch/include>
|
||||
|
|
|
@ -36,6 +36,9 @@ add_library(bitcoin_util STATIC EXCLUDE_FROM_ALL
|
|||
../sync.cpp
|
||||
)
|
||||
|
||||
# Workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/24058
|
||||
set_target_properties(bitcoin_util PROPERTIES OPTIMIZE_DEPENDENCIES OFF)
|
||||
|
||||
target_link_libraries(bitcoin_util
|
||||
PRIVATE
|
||||
core_interface
|
||||
|
|
Loading…
Add table
Reference in a new issue