summaryrefslogtreecommitdiff
path: root/shaderc/fix-glslang-link-order.patch
blob: a404c858390eca3b9e2edfc71672cf717633e67f (plain)
    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 
    6 libglslang depends on libHLSL, so the latter needs to be specified last.
    7 This fixes an issue when trying to build shaderc against system-wide
    8 versions of libglslang/libHLSL, rather than the in-tree versions from
    9 third_party.
   10 
   11 Additionally, libshaderc_util also depends on SPIRV-Tools
   12 ---
   13  glslc/CMakeLists.txt           | 2 +-
   14  libshaderc_util/CMakeLists.txt | 4 ++--
   15  2 files changed, 3 insertions(+), 3 deletions(-)
   16 
   17 diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
   18 index acf6fb0b..0f5d8886 100644
   19 --- a/glslc/CMakeLists.txt
   20 +++ b/glslc/CMakeLists.txt
   21 @@ -18,7 +18,7 @@ add_library(glslc STATIC
   22  shaderc_default_compile_options(glslc)
   23  target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR})
   24  target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler
   25 -  HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT})
   26 +  glslang SPIRV HLSL ${CMAKE_THREAD_LIBS_INIT})
   27  target_link_libraries(glslc PRIVATE shaderc_util shaderc)
   28  
   29  add_executable(glslc_exe src/main.cc)
   30 diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt
   31 index 873540ab..6d0c465c 100644
   32 --- a/libshaderc_util/CMakeLists.txt
   33 +++ b/libshaderc_util/CMakeLists.txt
   34 @@ -34,8 +34,8 @@ endif(SHADERC_ENABLE_INSTALL)
   35  
   36  find_package(Threads)
   37  target_link_libraries(shaderc_util PRIVATE
   38 -  glslang OSDependent OGLCompiler HLSL glslang SPIRV
   39 -  SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
   40 +  glslang OSDependent OGLCompiler glslang HLSL SPIRV
   41 +  SPIRV-Tools-opt SPIRV-Tools ${CMAKE_THREAD_LIBS_INIT})
   42  
   43  shaderc_add_tests(
   44    TEST_PREFIX shaderc_util

Generated by cgit