|
0 |
Author: Reiner Herrmann <reiner@reiner-h.de>
|
|
1 |
Description: Allow building with system libraries
|
|
2 |
- shaderc contained a third_party directory with a bunch of bundled
|
|
3 |
libraries that are available in Debian.
|
|
4 |
|
|
5 |
--- a/lib/shaderc/CMakeLists.txt
|
|
6 |
+++ b/lib/shaderc/CMakeLists.txt
|
|
7 |
@@ -124,7 +124,6 @@
|
|
8 |
|
|
9 |
# Configure subdirectories.
|
|
10 |
# We depend on these for later projects, so they should come first.
|
|
11 |
-add_subdirectory(third_party)
|
|
12 |
|
|
13 |
add_subdirectory(libshaderc_util)
|
|
14 |
add_subdirectory(libshaderc)
|
|
15 |
--- a/lib/shaderc/libshaderc_util/src/compiler.cc
|
|
16 |
+++ b/lib/shaderc/libshaderc_util/src/compiler.cc
|
|
17 |
@@ -20,7 +20,7 @@
|
|
18 |
#include <thread>
|
|
19 |
#include <tuple>
|
|
20 |
|
|
21 |
-#include "SPIRV/GlslangToSpv.h"
|
|
22 |
+#include <glslang/SPIRV/GlslangToSpv.h>
|
|
23 |
#include "libshaderc_util/format.h"
|
|
24 |
#include "libshaderc_util/io_shaderc.h"
|
|
25 |
#include "libshaderc_util/message.h"
|
|
26 |
--- a/lib/shaderc/libshaderc/CMakeLists.txt
|
|
27 |
+++ b/lib/shaderc/libshaderc/CMakeLists.txt
|
|
28 |
@@ -14,6 +14,9 @@
|
|
29 |
|
|
30 |
project(libshaderc)
|
|
31 |
|
|
32 |
+find_package(PkgConfig)
|
|
33 |
+pkg_check_modules(GLSLANG REQUIRED glslang)
|
|
34 |
+
|
|
35 |
# Even though shaderc.hpp is a headers-only library, adding
|
|
36 |
# a dependency here will force clients of the library to rebuild
|
|
37 |
# when it changes.
|
|
38 |
@@ -62,7 +65,7 @@
|
|
39 |
|
|
40 |
find_package(Threads)
|
|
41 |
set(SHADERC_LIBS
|
|
42 |
- glslang OSDependent OGLCompiler glslang ${CMAKE_THREAD_LIBS_INIT}
|
|
43 |
+ ${GLSLANG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
|
|
44 |
shaderc_util
|
|
45 |
SPIRV # from glslang
|
|
46 |
SPIRV-Tools
|
|
47 |
--- a/lib/shaderc/libshaderc_util/CMakeLists.txt
|
|
48 |
+++ b/lib/shaderc/libshaderc_util/CMakeLists.txt
|
|
49 |
@@ -14,6 +14,9 @@
|
|
50 |
|
|
51 |
project(libshaderc_util)
|
|
52 |
|
|
53 |
+find_package(PkgConfig)
|
|
54 |
+pkg_check_modules(GLSLANG REQUIRED glslang)
|
|
55 |
+
|
|
56 |
add_library(shaderc_util STATIC
|
|
57 |
include/libshaderc_util/counting_includer.h
|
|
58 |
include/libshaderc_util/file_finder.h
|
|
59 |
@@ -46,7 +49,7 @@
|
|
60 |
|
|
61 |
find_package(Threads)
|
|
62 |
target_link_libraries(shaderc_util PRIVATE
|
|
63 |
- glslang OSDependent OGLCompiler HLSL glslang SPIRV
|
|
64 |
+ ${GLSLANG_LIBRARIES} SPIRV
|
|
65 |
SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
|
|
66 |
|
|
67 |
shaderc_add_tests(
|