From fdb016c7e5bdac1e152dd2e725d600cfd3dd75d8 Mon Sep 17 00:00:00 2001 From: nihuini Date: Mon, 21 Nov 2022 17:11:47 +0800 Subject: [PATCH] update glslang --- cmake/ncnnConfig.cmake.in | 33 +++++++++++++++++++++------------ glslang | 2 +- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/cmake/ncnnConfig.cmake.in b/cmake/ncnnConfig.cmake.in index b118713571e9..9679ccc09fde 100644 --- a/cmake/ncnnConfig.cmake.in +++ b/cmake/ncnnConfig.cmake.in @@ -19,20 +19,29 @@ if(NCNN_VULKAN) if(NOT NCNN_SHARED_LIB) if(NCNN_SYSTEM_GLSLANG) - set(GLSLANG_TARGET_DIR "@GLSLANG_TARGET_DIR@") + find_package(glslang QUIET) + if(glslang_FOUND) + add_library(glslang ALIAS glslang::glslang) + add_library(SPIRV ALIAS glslang::SPIRV) + else() + set(GLSLANG_TARGET_DIR "@GLSLANG_TARGET_DIR@") + 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) + endif() else() - set(GLSLANG_TARGET_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../@CMAKE_INSTALL_LIBDIR@/cmake") - endif(NCNN_SYSTEM_GLSLANG) - - 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") + set(glslang_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../@CMAKE_INSTALL_LIBDIR@/cmake/glslang") + find_package(glslang QUIET) + add_library(glslang ALIAS glslang::glslang) + add_library(SPIRV ALIAS glslang::SPIRV) endif() - include(${GLSLANG_TARGET_DIR}/glslangTargets.cmake) - include(${GLSLANG_TARGET_DIR}/SPIRVTargets.cmake) + endif() -endif(NCNN_VULKAN) +endif() include(${CMAKE_CURRENT_LIST_DIR}/ncnn.cmake) diff --git a/glslang b/glslang index 86ff4bca1ddc..88fd417b0bb7 160000 --- a/glslang +++ b/glslang @@ -1 +1 @@ -Subproject commit 86ff4bca1ddc7e2262f119c16e7228d0efb67610 +Subproject commit 88fd417b0bb7d91755961c70e846d274c182f2b0