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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
From 8f16c974fc8ec0b286d803490baa6e00a83615cf Mon Sep 17 00:00:00 2001
From: Matthew Smith <matt@offtopica.uk>
Date: Sun, 30 Jan 2022 18:07:51 +0000
Subject: [PATCH 2/3] build: Use system compression libs
---
CMakeLists.txt | 6 +++
renderdoc/CMakeLists.txt | 48 +------------------
renderdoc/core/replay_proxy.cpp | 2 +-
.../driver/shaders/dxbc/dxbc_container.cpp | 2 +-
renderdoc/serialise/lz4io.h | 2 +-
5 files changed, 10 insertions(+), 50 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb0a2c7f6..0ee4fc629 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -473,6 +473,12 @@
endif()
endif()
+find_package(PkgConfig REQUIRED)
+find_package(miniz REQUIRED CONFIG)
+
+pkg_check_modules(lz4 REQUIRED IMPORTED_TARGET liblz4)
+pkg_check_modules(zstd REQUIRED IMPORTED_TARGET libzstd)
+
add_subdirectory(renderdoc)
# these variables are handled within the CMakeLists.txt in qrenderdoc,
diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt
index 927e95fb9..5908be6de 100644
--- a/renderdoc/CMakeLists.txt
+++ b/renderdoc/CMakeLists.txt
@@ -218,56 +218,10 @@ set(sources
3rdparty/pugixml/pugixml.cpp
3rdparty/pugixml/pugixml.hpp
3rdparty/pugixml/pugiconfig.hpp
- 3rdparty/lz4/lz4.c
- 3rdparty/lz4/lz4.h
3rdparty/md5/md5.c
3rdparty/md5/md5.h
- 3rdparty/miniz/miniz.c
- 3rdparty/miniz/miniz.h
3rdparty/superluminal/superluminal.cpp
3rdparty/superluminal/superluminal.h
- 3rdparty/zstd/bitstream.h
- 3rdparty/zstd/compiler.h
- 3rdparty/zstd/cpu.h
- 3rdparty/zstd/debug.c
- 3rdparty/zstd/debug.h
- 3rdparty/zstd/entropy_common.c
- 3rdparty/zstd/error_private.c
- 3rdparty/zstd/error_private.h
- 3rdparty/zstd/fse.h
- 3rdparty/zstd/fse_compress.c
- 3rdparty/zstd/fse_decompress.c
- 3rdparty/zstd/hist.c
- 3rdparty/zstd/hist.h
- 3rdparty/zstd/huf.h
- 3rdparty/zstd/huf_compress.c
- 3rdparty/zstd/huf_decompress.c
- 3rdparty/zstd/mem.h
- 3rdparty/zstd/pool.c
- 3rdparty/zstd/pool.h
- 3rdparty/zstd/threading.c
- 3rdparty/zstd/threading.h
- 3rdparty/zstd/xxhash.c
- 3rdparty/zstd/xxhash.h
- 3rdparty/zstd/zstd.h
- 3rdparty/zstd/zstd_common.c
- 3rdparty/zstd/zstd_compress.c
- 3rdparty/zstd/zstd_compress_internal.h
- 3rdparty/zstd/zstd_decompress.c
- 3rdparty/zstd/zstd_double_fast.c
- 3rdparty/zstd/zstd_double_fast.h
- 3rdparty/zstd/zstd_errors.h
- 3rdparty/zstd/zstd_fast.c
- 3rdparty/zstd/zstd_fast.h
- 3rdparty/zstd/zstd_internal.h
- 3rdparty/zstd/zstd_lazy.c
- 3rdparty/zstd/zstd_lazy.h
- 3rdparty/zstd/zstd_ldm.c
- 3rdparty/zstd/zstd_ldm.h
- 3rdparty/zstd/zstd_opt.c
- 3rdparty/zstd/zstd_opt.h
- 3rdparty/zstd/zstdmt_compress.c
- 3rdparty/zstd/zstdmt_compress.h
3rdparty/stb/stb_image.h
3rdparty/stb/stb_image_write.h
3rdparty/stb/stb_image_resize.h
@@ -580,7 +534,7 @@ endif()
add_library(renderdoc SHARED ${renderdoc_objects})
target_compile_definitions(renderdoc ${RDOC_DEFINITIONS})
target_include_directories(renderdoc ${RDOC_INCLUDES})
-target_link_libraries(renderdoc ${RDOC_LIBRARIES})
+target_link_libraries(renderdoc ${RDOC_LIBRARIES} miniz::miniz PkgConfig::lz4 PkgConfig::zstd)
add_dependencies(renderdoc renderdoc_libentry)
diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp
index dea1e86cf..c9362e797 100644
--- a/renderdoc/core/replay_proxy.cpp
+++ b/renderdoc/core/replay_proxy.cpp
@@ -25,7 +25,7 @@
#include "replay_proxy.h"
#include <list>
-#include "lz4/lz4.h"
+#include <lz4.h>
#include "replay/dummy_driver.h"
#include "serialise/lz4io.h"
diff --git a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp
index ede1fdeb7..0c8fd4dfe 100644
--- a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp
+++ b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp
@@ -29,7 +29,7 @@
#include "common/common.h"
#include "core/settings.h"
#include "driver/shaders/dxil/dxil_bytecode.h"
-#include "lz4/lz4.h"
+#include <lz4.h>
#include "md5/md5.h"
#include "serialise/serialiser.h"
#include "strings/string_utils.h"
diff --git a/renderdoc/serialise/lz4io.h b/renderdoc/serialise/lz4io.h
index 199fbbbc1..80fdf94f2 100644
--- a/renderdoc/serialise/lz4io.h
+++ b/renderdoc/serialise/lz4io.h
@@ -24,7 +24,7 @@
#pragma once
-#include "lz4/lz4.h"
+#include <lz4.h>
#include "streamio.h"
class LZ4Compressor : public Compressor
--
2.35.1
|