From df841b241efd387044d9637b1cf67d198bd1398e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 19 Feb 2021 12:04:32 +0800 Subject: [PATCH] cmake: build static libs if they are internal ones there are chances that user or build script set `BUILD_SHARED_LIBS`, so these convenience libraries (using the autotools' terminology) are built and linked by never get installed. Fixes: https://tracker.ceph.com/issues/38611 Fixes: https://tracker.ceph.com/issues/49080 Signed-off-by: Kefu Chai --- src/blk/CMakeLists.txt | 2 +- src/common/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blk/CMakeLists.txt b/src/blk/CMakeLists.txt index c1de15ecfb7d..b397d47338b0 100644 --- a/src/blk/CMakeLists.txt +++ b/src/blk/CMakeLists.txt @@ -25,7 +25,7 @@ if(WITH_ZBD) zoned/HMSMRDevice.cc) endif() -add_library(blk ${libblk_srcs}) +add_library(blk STATIC ${libblk_srcs}) target_include_directories(blk PRIVATE "./") if(HAVE_LIBAIO) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 6f29dfef3508..498e2dd2de01 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -213,7 +213,7 @@ elseif(HAVE_ARMV8_CRC) crc32c_aarch64.c) endif(HAVE_INTEL) -add_library(crc32 ${crc32_srcs}) +add_library(crc32 STATIC ${crc32_srcs}) if(HAVE_ARMV8_CRC) set_target_properties(crc32 PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} ${ARMV8_CRC_COMPILE_FLAGS}") -- 2.47.3