Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 1 | From 0b9468d4face34879214f500b15e810cdd1a81a1 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 | Upstream-Status: Backport [21c8be385b3fab5edcb934a6d99f69fd389c4e67] |
| 14 | |
| 15 | Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> |
| 16 | |
| 17 | --- |
| 18 | glslc/CMakeLists.txt | 2 +- |
| 19 | libshaderc_util/CMakeLists.txt | 4 ++-- |
| 20 | 2 files changed, 3 insertions(+), 3 deletions(-) |
| 21 | |
| 22 | diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt |
| 23 | index 31664d1..35b3f19 100644 |
| 24 | --- a/glslc/CMakeLists.txt |
| 25 | +++ b/glslc/CMakeLists.txt |
| 26 | @@ -43,7 +43,7 @@ if (SHADERC_ENABLE_WGSL_OUTPUT) |
| 27 | endif(SHADERC_ENABLE_WGSL_OUTPUT) |
| 28 | |
| 29 | target_link_libraries(glslc PRIVATE |
| 30 | - glslang OSDependent OGLCompiler HLSL glslang SPIRV # Glslang libraries |
| 31 | + glslang OSDependent OGLCompiler glslang SPIRV HLSL # Glslang libraries |
| 32 | $<$<BOOL:${SHADERC_ENABLE_WGSL_OUTPUT}>:libtint> # Tint libraries, optional |
| 33 | shaderc_util shaderc # internal Shaderc libraries |
| 34 | ${CMAKE_THREAD_LIBS_INIT}) |
| 35 | diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt |
| 36 | index 48f9991..984cc06 100644 |
| 37 | --- a/libshaderc_util/CMakeLists.txt |
| 38 | +++ b/libshaderc_util/CMakeLists.txt |
| 39 | @@ -46,8 +46,8 @@ add_definitions(-DENABLE_HLSL) |
| 40 | |
| 41 | find_package(Threads) |
| 42 | target_link_libraries(shaderc_util PRIVATE |
| 43 | - glslang OSDependent OGLCompiler HLSL glslang SPIRV |
| 44 | - SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT}) |
| 45 | + glslang OSDependent OGLCompiler glslang HLSL SPIRV |
| 46 | + SPIRV-Tools-opt SPIRV-Tools ${CMAKE_THREAD_LIBS_INIT}) |
| 47 | |
| 48 | shaderc_add_tests( |
| 49 | TEST_PREFIX shaderc_util |