mirror of
https://github.com/ceph/ceph
synced 2025-01-03 01:22:53 +00:00
cmake: add WITH_STATIC_LIBSTDCXX option
to link libceph-common with libstdc++ if it is enabled.
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 4c2216de6a
)
This commit is contained in:
parent
020f641bdf
commit
c869054645
@ -169,6 +169,13 @@ else(ENABLE_SHARED)
|
||||
endif(ENABLE_SHARED)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ${ENABLE_SHARED})
|
||||
|
||||
option(WITH_STATIC_LIBSTDCXX "Link against libstdc++ statically" OFF)
|
||||
if(WITH_STATIC_LIBSTDCXX)
|
||||
if(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||
message(FATAL_ERROR "Please use GCC to enable WITH_STATIC_LIBSTDCXX")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(WITH_RDMA "Enable RDMA in async messenger" ON)
|
||||
if(WITH_RDMA)
|
||||
find_package(rdma REQUIRED)
|
||||
|
@ -688,6 +688,10 @@ target_link_libraries(ceph-common ${ceph_common_deps})
|
||||
set_target_properties(ceph-common PROPERTIES
|
||||
SOVERSION 0
|
||||
INSTALL_RPATH "")
|
||||
if(WITH_STATIC_LIBSTDCXX)
|
||||
set_target_properties(ceph-common PROPERTIES
|
||||
LINK_FLAGS "-static-libstdc++ -static-libgcc")
|
||||
endif()
|
||||
install(TARGETS ceph-common DESTINATION ${CMAKE_INSTALL_PKGLIBDIR})
|
||||
|
||||
add_library(common_utf8 STATIC common/utf8.c)
|
||||
|
Loading…
Reference in New Issue
Block a user