Author: Reiner Herrmann <reiner@reiner-h.de>
Description: Allow building with system libraries
 - shaderc contained a third_party directory with a bunch of bundled
   libraries that are available in Debian.

--- a/lib/shaderc/CMakeLists.txt
+++ b/lib/shaderc/CMakeLists.txt
@@ -124,7 +124,6 @@
 
 # Configure subdirectories.
 # We depend on these for later projects, so they should come first.
-add_subdirectory(third_party)
 
 add_subdirectory(libshaderc_util)
 add_subdirectory(libshaderc)
--- a/lib/shaderc/libshaderc_util/src/compiler.cc
+++ b/lib/shaderc/libshaderc_util/src/compiler.cc
@@ -20,7 +20,7 @@
 #include <thread>
 #include <tuple>
 
-#include "SPIRV/GlslangToSpv.h"
+#include <glslang/SPIRV/GlslangToSpv.h>
 #include "libshaderc_util/format.h"
 #include "libshaderc_util/io_shaderc.h"
 #include "libshaderc_util/message.h"
--- a/lib/shaderc/libshaderc/CMakeLists.txt
+++ b/lib/shaderc/libshaderc/CMakeLists.txt
@@ -14,6 +14,9 @@
 
 project(libshaderc)
 
+find_package(PkgConfig)
+pkg_check_modules(GLSLANG REQUIRED glslang)
+
 # Even though shaderc.hpp is a headers-only library, adding
 # a dependency here will force clients of the library to rebuild
 # when it changes.
@@ -62,7 +65,7 @@
 
 find_package(Threads)
 set(SHADERC_LIBS
-  glslang OSDependent OGLCompiler glslang ${CMAKE_THREAD_LIBS_INIT}
+  ${GLSLANG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
   shaderc_util
   SPIRV # from glslang
   SPIRV-Tools
--- a/lib/shaderc/libshaderc_util/CMakeLists.txt
+++ b/lib/shaderc/libshaderc_util/CMakeLists.txt
@@ -14,6 +14,9 @@
 
 project(libshaderc_util)
 
+find_package(PkgConfig)
+pkg_check_modules(GLSLANG REQUIRED glslang)
+
 add_library(shaderc_util STATIC
   include/libshaderc_util/counting_includer.h
   include/libshaderc_util/file_finder.h
@@ -46,7 +49,7 @@
 
 find_package(Threads)
 target_link_libraries(shaderc_util PRIVATE
-  glslang OSDependent OGLCompiler HLSL glslang SPIRV
+  ${GLSLANG_LIBRARIES} SPIRV
   SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
 
 shaderc_add_tests(
