Merge pull request #297349 from iynaix/fix-realesrgan-ncnn-vulkan

realesrgan-ncnn-vulkan: fix build for glslang 14.1.0
This commit is contained in:
Weijia Wang 2024-05-11 11:14:55 +02:00 committed by GitHub
commit eeeb66ce09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 6 deletions

View File

@ -1,15 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e7b71a..e743ab0 100644
index 1e7b71a..2ac2826 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -106,9 +106,9 @@ if(USE_SYSTEM_NCNN)
@@ -106,20 +106,13 @@ if(USE_SYSTEM_NCNN)
message(STATUS "Using glslang install located at ${GLSLANG_TARGET_DIR}")
find_package(Threads)
+ find_package(glslang REQUIRED)
+ find_package(SPIRV-Tools-opt REQUIRED)
include("${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake")
- include("${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake")
- include("${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake")
if(EXISTS "${GLSLANG_TARGET_DIR}/HLSLTargets.cmake")
# hlsl support can be optional
include("${GLSLANG_TARGET_DIR}/HLSLTargets.cmake")
endif()
- include("${GLSLANG_TARGET_DIR}/glslangTargets.cmake")
- include("${GLSLANG_TARGET_DIR}/SPIRVTargets.cmake")
-
- if (NOT TARGET glslang OR NOT TARGET SPIRV)
- message(WARNING "glslang or SPIRV target not found! USE_SYSTEM_NCNN will be turned off.")
- set(USE_SYSTEM_NCNN OFF)
- endif()
endif()
endif()

View File

@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
cp -r ${models}/models $out/share
'';
postFixup = ''
postFixup = lib.optionalString stdenv.isLinux ''
patchelf $out/bin/realesrgan-ncnn-vulkan --add-needed libvulkan.so
'';