From: JinWang An Date: Tue, 23 Jan 2024 05:52:49 +0000 (+0900) Subject: Fix build error at cmake 3.21.3 X-Git-Tag: accepted/tizen/unified/20240318.071444^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fgtest.git;a=commitdiff_plain;h=e370e7f6eab46c79f05c3bbc14ada20bea04b93f Fix build error at cmake 3.21.3 Change-Id: I45627b782bb454e93a858a1a67894b89e786dffb Signed-off-by: JinWang An --- diff --git a/packaging/Fix-build-error-at-cmake.patch b/packaging/Fix-build-error-at-cmake.patch index 7527041..81d5d20 100644 --- a/packaging/Fix-build-error-at-cmake.patch +++ b/packaging/Fix-build-error-at-cmake.patch @@ -1,32 +1,14 @@ -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 +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) + $) 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) diff --git a/packaging/gtest.spec b/packaging/gtest.spec index 904a5bf..03570f1 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