Fix build error at cmake 3.21.3 92/269492/5 accepted/tizen_7.0_unified_hotfix sandbox/backup/gtest_1.11.0_20221228 tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.055916 accepted/tizen/7.0/unified/hotfix/20221116.110849 accepted/tizen/unified/20220118.123240 submit/tizen/20220117.055339 tizen_7.0_m2_release
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 17 Jan 2022 04:58:08 +0000 (13:58 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 17 Jan 2022 05:13:47 +0000 (14:13 +0900)
armv7l-tizen-linux-gnueabi/bin/ld: cannot find -lThreads::Threads

Change-Id: Ib59af537a100c2d182cd66ab58057de5ec82d4af

packaging/Fix-build-error-at-cmake.patch [new file with mode: 0644]
packaging/gtest.spec

diff --git a/packaging/Fix-build-error-at-cmake.patch b/packaging/Fix-build-error-at-cmake.patch
new file mode 100644 (file)
index 0000000..7527041
--- /dev/null
@@ -0,0 +1,32 @@
+From 41039ce0cef643f44cf91ee11ca55b90c7f78a53 Mon Sep 17 00:00:00 2001
+From: DongHun Kwak <dh0128.kwak@samsung.com>
+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
+
index f6f8afe..42edff8 100644 (file)
@@ -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