summaryrefslogtreecommitdiff
path: root/sys-libs/zlib-ng/files/zlib-ng-2.1.2-cmake.patch
blob: 8deb07a605151c432fdde6b1992d8d4e2127be06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
https://github.com/zlib-ng/zlib-ng/issues/1515
https://github.com/zlib-ng/zlib-ng/pull/1519
https://github.com/zlib-ng/zlib-ng/commit/39136c20716a94188c1d041b9656315371d35a47

From 39136c20716a94188c1d041b9656315371d35a47 Mon Sep 17 00:00:00 2001
From: "Mika T. Lindqvist" <postmaster@raasu.org>
Date: Sun, 11 Jun 2023 18:38:12 +0300
Subject: [PATCH] Try to find system copy of googletest before trying to
 download it. * Don't use system copy if memory sanitizer is enabled

--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -111,8 +111,6 @@ if(WITH_BENCHMARKS)
 endif()
 
 if(WITH_GTEST)
-    include(FetchContent)
-
     # Google test requires at least C++11
     set(CMAKE_CXX_STANDARD 11)
 
@@ -125,9 +123,13 @@ if(WITH_GTEST)
         # Must set include and compile options before fetching googletest
         include_directories($ENV{LLVM_BUILD_DIR}/include $ENV{LLVM_BUILD_DIR}/include/c++/v1)
         add_compile_options(-stdlib=libc++ -g)
+    elseif(NOT TARGET GTest::GTest)
+        find_package(GTest)
     endif()
 
     if(NOT TARGET GTest::GTest)
+        include(FetchContent)
+
         # Prevent overriding the parent project's compiler/linker settings for Windows
         set(gtest_force_shared_crt ON CACHE BOOL
             "Use shared (DLL) run-time lib even when Google Test is built as static lib." FORCE)