From ac47440174c6e0a5228bd63b5fa9baef542e52cc Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 3 Jun 2016 11:53:10 +0800 Subject: [PATCH] cmake: do not create gtest/gmock shared libraries otherwise unit tests crash at exit. Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 682b5b19f4c2..7dda69460fcc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -996,7 +996,12 @@ target_link_libraries(crushtool global) install(TARGETS crushtool DESTINATION bin) # Support/Tools +# the static gtest/gmock libraries load correctly for us +set(BUILD_SHARED_LIBS_saved ${BUILD_SHARED_LIBS}) +set(BUILD_SHARED_LIBS OFF) add_subdirectory(gmock) +set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_saved}) + add_subdirectory(test) set(cephfs_srcs cephfs.cc) add_executable(cephfstool ${cephfs_srcs}) -- 2.47.3