fix-glslang-link-order.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From 21c8be385b3fab5edcb934a6d99f69fd389c4e67 Mon Sep 17 00:00:00 2001
  2. From: Niklas Haas <git@haasn.xyz>
  3. Date: Tue, 29 May 2018 07:34:00 +0200
  4. Subject: [PATCH] Fix the link order of libglslang and libHLSL
  5. libglslang depends on libHLSL, so the latter needs to be specified last.
  6. This fixes an issue when trying to build shaderc against system-wide
  7. versions of libglslang/libHLSL, rather than the in-tree versions from
  8. third_party.
  9. Additionally, libshaderc_util also depends on SPIRV-Tools
  10. ---
  11. glslc/CMakeLists.txt | 2 +-
  12. libshaderc_util/CMakeLists.txt | 4 ++--
  13. 2 files changed, 3 insertions(+), 3 deletions(-)
  14. diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
  15. index acf6fb0..0f5d888 100644
  16. --- a/glslc/CMakeLists.txt
  17. +++ b/glslc/CMakeLists.txt
  18. @@ -18,7 +18,7 @@ add_library(glslc STATIC
  19. shaderc_default_compile_options(glslc)
  20. target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR})
  21. target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler
  22. - HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT})
  23. + glslang SPIRV HLSL ${CMAKE_THREAD_LIBS_INIT})
  24. target_link_libraries(glslc PRIVATE shaderc_util shaderc)
  25. add_executable(glslc_exe src/main.cc)
  26. diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt
  27. index 873540a..6d0c465 100644
  28. --- a/libshaderc_util/CMakeLists.txt
  29. +++ b/libshaderc_util/CMakeLists.txt
  30. @@ -34,8 +34,8 @@ endif(SHADERC_ENABLE_INSTALL)
  31. find_package(Threads)
  32. target_link_libraries(shaderc_util PRIVATE
  33. - glslang OSDependent OGLCompiler HLSL glslang SPIRV
  34. - SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
  35. + glslang OSDependent OGLCompiler glslang HLSL SPIRV
  36. + SPIRV-Tools-opt SPIRV-Tools ${CMAKE_THREAD_LIBS_INIT})
  37. shaderc_add_tests(
  38. TEST_PREFIX shaderc_util