Skip to content

Commit

Permalink
update glslang (#4361)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored Nov 21, 2022
1 parent 0736c5b commit f527fe8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
33 changes: 21 additions & 12 deletions cmake/ncnnConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion glslang
Submodule glslang updated 920 files

0 comments on commit f527fe8

Please sign in to comment.