Skip to content

Commit 3b42e05

Browse files
committed
cmake: Make implicit libbitcoinkernel dependencies explicit
This change fixes a regression introduced by enabling the `OPTIMIZE_DEPENDENCIES` property.
1 parent 3fd64ef commit 3b42e05

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/kernel/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ set_target_properties(bitcoinkernel PROPERTIES
102102
CXX_VISIBILITY_PRESET default
103103
)
104104

105+
# Add a convenience libbitcoinkernel target as a synonym for bitcoinkernel.
106+
add_custom_target(libbitcoinkernel)
107+
add_dependencies(libbitcoinkernel bitcoinkernel)
108+
105109
# When building the static library, install all static libraries the
106110
# bitcoinkernel depends on.
107111
if(NOT BUILD_SHARED_LIBS)
@@ -110,6 +114,7 @@ if(NOT BUILD_SHARED_LIBS)
110114
get_target_property(linked_libraries ${target} LINK_LIBRARIES)
111115
foreach(dep ${linked_libraries})
112116
if(TARGET ${dep})
117+
add_dependencies(libbitcoinkernel ${dep})
113118
get_target_property(dep_type ${dep} TYPE)
114119
if(dep_type STREQUAL "STATIC_LIBRARY")
115120
list(APPEND ${libs_out} ${dep})
@@ -132,10 +137,6 @@ endif()
132137
configure_file(${PROJECT_SOURCE_DIR}/libbitcoinkernel.pc.in ${PROJECT_BINARY_DIR}/libbitcoinkernel.pc @ONLY)
133138
install(FILES ${PROJECT_BINARY_DIR}/libbitcoinkernel.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" COMPONENT libbitcoinkernel)
134139

135-
# Add a convenience libbitcoinkernel target as a synonym for bitcoinkernel.
136-
add_custom_target(libbitcoinkernel)
137-
add_dependencies(libbitcoinkernel bitcoinkernel)
138-
139140
install(TARGETS bitcoinkernel
140141
RUNTIME
141142
DESTINATION ${CMAKE_INSTALL_BINDIR}

0 commit comments

Comments
 (0)