Fix build error at cmake 3.21.3 80/304680/1 accepted/tizen_unified accepted/tizen_unified_x tizen accepted/tizen/unified/20240318.071444 accepted/tizen/unified/x/20240320.133043
authorJinWang An <jinwang.an@samsung.com>
Tue, 23 Jan 2024 05:52:49 +0000 (14:52 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 23 Jan 2024 05:52:49 +0000 (14:52 +0900)
Change-Id: I45627b782bb454e93a858a1a67894b89e786dffb
Signed-off-by: JinWang An <jinwang.an@samsung.com>
packaging/Fix-build-error-at-cmake.patch
packaging/gtest.spec

index 7527041..81d5d20 100644 (file)
@@ -1,32 +1,14 @@
-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
+index 64fa340..b12c4a6 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()
+@@ -192,7 +192,8 @@ function(cxx_library_with_type name type cxx_flags)
+       $<INSTALL_INTERFACE:GTEST_LINKED_AS_SHARED_LIBRARY=1>)
    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()
+-    target_link_libraries(${name} PUBLIC Threads::Threads)
 +    set(threads_spec ${CMAKE_THREAD_LIBS_INIT})
-     target_link_libraries(${name} PUBLIC ${threads_spec})
++    target_link_libraries(${name} PUBLIC ${threads_spec})
    endif()
-
---
-2.25.1
-
+   target_compile_features(${name} PUBLIC cxx_std_14)
index 904a5bf..03570f1 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