build-unit-test-docker: Ensure pthread flag is -pthread
googletest and googlemock incorrectly use CMAKE_THREAD_LIBS_INIT in the
Cflags declaration for their .pc files. We can make this work by
ensuring that CMAKE_THREAD_LIBS_INIT is always -pthread which works as a
Cflag and Linker flag.
See google/googletest#2006
Change-Id: Ib53d23c34e61e986e14e9e2a41a092b4c8e545af
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/build-unit-test-docker.sh b/build-unit-test-docker.sh
index 72ebf87..11cb6f5 100755
--- a/build-unit-test-docker.sh
+++ b/build-unit-test-docker.sh
@@ -215,7 +215,7 @@
cd googletest-* && \
mkdir build && \
cd build && \
-cmake ${CMAKE_FLAGS[@]} -DBUILD_GTEST=ON -DBUILD_GMOCK=ON .. && \
+cmake ${CMAKE_FLAGS[@]} -DTHREADS_PREFER_PTHREAD_FLAG=ON -DBUILD_GTEST=ON -DBUILD_GMOCK=ON .. && \
make -j$(nproc) && \
make install