mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Merge 24817e8b15 into merged_master (Bitcoin PR bitcoin/bitcoin#30814)
This commit is contained in:
commit
51fa77ab68
2 changed files with 45 additions and 0 deletions
|
|
@ -123,6 +123,40 @@ set_target_properties(bitcoinkernel PROPERTIES
|
|||
CXX_VISIBILITY_PRESET default
|
||||
)
|
||||
|
||||
# When building the static library, install all static libraries the
|
||||
# bitcoinkernel depends on.
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
# Recursively get all the static libraries a target depends on and put them in libs_out
|
||||
function(get_target_static_link_libs target libs_out)
|
||||
get_target_property(linked_libraries ${target} LINK_LIBRARIES)
|
||||
foreach(dep ${linked_libraries})
|
||||
if(TARGET ${dep})
|
||||
get_target_property(dep_type ${dep} TYPE)
|
||||
if(dep_type STREQUAL "STATIC_LIBRARY")
|
||||
list(APPEND ${libs_out} ${dep})
|
||||
get_target_static_link_libs(${dep} ${libs_out})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
set(${libs_out} ${${libs_out}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
set(all_kernel_static_link_libs "")
|
||||
get_target_static_link_libs(bitcoinkernel all_kernel_static_link_libs)
|
||||
|
||||
# LIBS_PRIVATE is substituted in the pkg-config file.
|
||||
set(LIBS_PRIVATE "")
|
||||
foreach(lib ${all_kernel_static_link_libs})
|
||||
install(TARGETS ${lib} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
string(APPEND LIBS_PRIVATE " -l${lib}")
|
||||
endforeach()
|
||||
|
||||
string(STRIP "${LIBS_PRIVATE}" LIBS_PRIVATE)
|
||||
endif()
|
||||
|
||||
configure_file(${PROJECT_SOURCE_DIR}/libbitcoinkernel.pc.in ${PROJECT_BINARY_DIR}/libbitcoinkernel.pc @ONLY)
|
||||
install(FILES ${PROJECT_BINARY_DIR}/libbitcoinkernel.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS bitcoinkernel
|
||||
RUNTIME
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue