From 719c0f91bfd90b0afb2e15d3bafa44ac8faeaf90 Mon Sep 17 00:00:00 2001 From: Sylvain Oliver Date: Wed, 1 Apr 2020 13:50:40 -0700 Subject: [PATCH] Add dependency of gtest on pthread (#6572) Summary: Compilation of rocksdb fails because -lpthread flag is needed by gtest **Before modification** : /usr/bin/c++ -W -Wextra -Wall -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-strict-aliasing -std=c++11 -march=native -Werror -fno-builtin-memcmp -g -DROCKSDB_USE_RTTI CMakeFiles/table_reader_bench.dir/table/table_reader_bench.cc.o -o table_reader_bench -Wl,-rpath,/develop/src/rocksdb/build librocksdb.so.6.8.0 libtestharness.a /usr/lib/x86_64-linux-gnu/libgflags.so -lpthread third-party/gtest-1.8.1/fused-src/gtest/libgtest.a **After modification** : /usr/bin/c++ -W -Wextra -Wall -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-strict-aliasing -std=c++11 -march=native -Werror -fno-builtin-memcmp -g -DROCKSDB_USE_RTTI CMakeFiles/table_reader_bench.dir/table/table_reader_bench.cc.o -o table_reader_bench -Wl,-rpath,/develop/src/rocksdb/build librocksdb.so.6.8.0 libtestharness.a /usr/lib/x86_64-linux-gnu/libgflags.so third-party/gtest-1.8.1/fused-src/gtest/libgtest.a -lpthread Pull Request resolved: https://github.com/facebook/rocksdb/pull/6572 Reviewed By: anand1976 Differential Revision: D20789059 Pulled By: ajkr fbshipit-source-id: 97329f14b9044b12c8a415da3d5f27b256ff8ff7 --- third-party/gtest-1.8.1/fused-src/gtest/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/third-party/gtest-1.8.1/fused-src/gtest/CMakeLists.txt b/third-party/gtest-1.8.1/fused-src/gtest/CMakeLists.txt index 90cff0880..211e8a8e1 100644 --- a/third-party/gtest-1.8.1/fused-src/gtest/CMakeLists.txt +++ b/third-party/gtest-1.8.1/fused-src/gtest/CMakeLists.txt @@ -1 +1,4 @@ add_library(gtest gtest-all.cc) + +# Add dependency of gtest on thread library +target_link_libraries(gtest ${CMAKE_THREAD_LIBS_INIT})