File: use-system-snappy

package info (click to toggle)
apitrace 11.1%2Brepack-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,620 kB
  • sloc: cpp: 183,110; python: 33,685; ansic: 25,073; sh: 143; makefile: 88
file content (34 lines) | stat: -rw-r--r-- 1,105 bytes parent folder | download | duplicates (3)
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
Description: Use system libsnappy for retracers
 The tracers run LD_PRELOADed into arbitrary, often closed-source binaries,
 so statically-link libsnappy to minimise the possibility of symbol conflicts,
 but the retracers don't have that constraint and are used to process untrusted
 data.
Forwarded: not-needed
Author: Christopher James Halse Rogers <raof@ubuntu.com>

--- a/lib/trace/CMakeLists.txt
+++ b/lib/trace/CMakeLists.txt
@@ -31,7 +31,7 @@ target_link_libraries (common
     guids
     highlight
     os
-    Snappy::snappy
+    ${SNAPPY_STATIC_LIBRARIES}
     ZLIB::ZLIB
     PkgConfig::BROTLIDEC
 )
--- a/thirdparty/CMakeLists.txt
+++ b/thirdparty/CMakeLists.txt
@@ -32,8 +32,10 @@ if (SUBMODULES_MISSING)
 endif ()
 
 if (ENABLE_STATIC_SNAPPY OR NOT Snappy_FOUND)
-    message (STATUS "Using bundled Snappy")
-    include_with_scope (snappy.cmake)
+    message (STATUS "Using static SNAPPY")
+    find_package(Snappy REQUIRED)
+    # Our libsnappy package builds a PIC libsnappy-shared.a archive.
+    find_library(SNAPPY_STATIC_LIBRARIES libsnappy-shared.a)
 endif ()
 
 if (NOT ZLIB_FOUND)