externals: allow user to use system glslang (#7075)
This commit is contained in:
parent
e49b3c75bd
commit
2d83fff581
|
@ -103,6 +103,7 @@ option(USE_SYSTEM_XBYAK "Use the system xbyak (instead of the bundled one)" OFF)
|
||||||
option(USE_SYSTEM_INIH "Use the system inih (instead of the bundled one)" OFF)
|
option(USE_SYSTEM_INIH "Use the system inih (instead of the bundled one)" OFF)
|
||||||
option(USE_SYSTEM_FDK_AAC_HEADERS "Use the system fdk-aac headers (instead of the bundled one)" OFF)
|
option(USE_SYSTEM_FDK_AAC_HEADERS "Use the system fdk-aac headers (instead of the bundled one)" OFF)
|
||||||
option(USE_SYSTEM_FFMPEG_HEADERS "Use the system FFmpeg headers (instead of the bundled one)" OFF)
|
option(USE_SYSTEM_FFMPEG_HEADERS "Use the system FFmpeg headers (instead of the bundled one)" OFF)
|
||||||
|
option(USE_SYSTEM_GLSLANG "Use the system glslang and SPIR-V libraries (instead of the bundled ones)" OFF)
|
||||||
|
|
||||||
if (CITRA_USE_PRECOMPILED_HEADERS)
|
if (CITRA_USE_PRECOMPILED_HEADERS)
|
||||||
message(STATUS "Using Precompiled Headers.")
|
message(STATUS "Using Precompiled Headers.")
|
||||||
|
|
|
@ -117,13 +117,24 @@ endif()
|
||||||
add_subdirectory(glad)
|
add_subdirectory(glad)
|
||||||
|
|
||||||
# glslang
|
# glslang
|
||||||
set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "")
|
if(USE_SYSTEM_GLSLANG)
|
||||||
set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "")
|
find_package(glslang REQUIRED)
|
||||||
set(ENABLE_SPVREMAPPER OFF CACHE BOOL "")
|
add_library(glslang INTERFACE)
|
||||||
set(ENABLE_CTEST OFF CACHE BOOL "")
|
add_library(SPIRV INTERFACE)
|
||||||
set(ENABLE_HLSL OFF CACHE BOOL "")
|
target_link_libraries(glslang INTERFACE glslang::glslang)
|
||||||
set(BUILD_EXTERNAL OFF CACHE BOOL "")
|
target_link_libraries(SPIRV INTERFACE glslang::SPIRV)
|
||||||
add_subdirectory(glslang)
|
# System include path is different from submodule include path
|
||||||
|
get_target_property(GLSLANG_PREFIX glslang::SPIRV INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
target_include_directories(SPIRV SYSTEM INTERFACE "${GLSLANG_PREFIX}/glslang")
|
||||||
|
else()
|
||||||
|
set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "")
|
||||||
|
set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "")
|
||||||
|
set(ENABLE_SPVREMAPPER OFF CACHE BOOL "")
|
||||||
|
set(ENABLE_CTEST OFF CACHE BOOL "")
|
||||||
|
set(ENABLE_HLSL OFF CACHE BOOL "")
|
||||||
|
set(BUILD_EXTERNAL OFF CACHE BOOL "")
|
||||||
|
add_subdirectory(glslang)
|
||||||
|
endif()
|
||||||
|
|
||||||
# inih
|
# inih
|
||||||
if(USE_SYSTEM_INIH)
|
if(USE_SYSTEM_INIH)
|
||||||
|
|
Loading…
Reference in New Issue