From 3f8aeb0db05c81da67f5d7819f21c0a2b9fb4180 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 17 Jan 2022 13:58:08 +0900 Subject: [PATCH] Fix build error at cmake 3.21.3 armv7l-tizen-linux-gnueabi/bin/ld: cannot find -lThreads::Threads Change-Id: Ib59af537a100c2d182cd66ab58057de5ec82d4af --- packaging/Fix-build-error-at-cmake.patch | 32 ++++++++++++++++++++++++++++++++ packaging/gtest.spec | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 packaging/Fix-build-error-at-cmake.patch diff --git a/packaging/Fix-build-error-at-cmake.patch b/packaging/Fix-build-error-at-cmake.patch new file mode 100644 index 0000000..7527041 --- /dev/null +++ b/packaging/Fix-build-error-at-cmake.patch @@ -0,0 +1,32 @@ +From 41039ce0cef643f44cf91ee11ca55b90c7f78a53 Mon Sep 17 00:00:00 2001 +From: DongHun Kwak +Date: Mon, 17 Jan 2022 13:58:08 +0900 +Subject: [PATCH] Fix build error at cmake 3.21.3 + +armv7l-tizen-linux-gnueabi/bin/ld: cannot find -lThreads::Threads + +Change-Id: Ib59af537a100c2d182cd66ab58057de5ec82d4af +--- + googletest/cmake/internal_utils.cmake | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake +index 8d8d60a..98a052e 100644 +--- a/googletest/cmake/internal_utils.cmake ++++ b/googletest/cmake/internal_utils.cmake +@@ -184,11 +184,7 @@ function(cxx_library_with_type name type cxx_flags) + endif() + endif() + if (DEFINED GTEST_HAS_PTHREAD) +- if ("${CMAKE_VERSION}" VERSION_LESS "3.1.0") +- set(threads_spec ${CMAKE_THREAD_LIBS_INIT}) +- else() +- set(threads_spec Threads::Threads) +- endif() ++ set(threads_spec ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(${name} PUBLIC ${threads_spec}) + endif() + +-- +2.25.1 + diff --git a/packaging/gtest.spec b/packaging/gtest.spec index f6f8afe..42edff8 100644 --- a/packaging/gtest.spec +++ b/packaging/gtest.spec @@ -9,6 +9,7 @@ License: BSD-3-Clause Group: Definition/Libraries/C and C++ Source0: %{name}-%{version}.tar.gz +Source1: Fix-build-error-at-cmake.patch Source1001: %{name}.manifest # ========================================================== @@ -39,6 +40,7 @@ Google C++ Testing Framework %prep %setup -q cp %{SOURCE1001} . +%{__patch} -p1 < %{SOURCE1} # ========================================================== # build section -- 2.7.4