2023-05-09 08:12:23 +08:00
diff --git a/CMakeLists.txt b/CMakeLists.txt
2024-04-22 22:18:02 +08:00
index 85d18322..0ad18049 100644
2023-05-09 08:12:23 +08:00
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
2024-04-22 22:18:02 +08:00
@@ -36,13 +36,14 @@ endif()
2024-03-12 07:38:39 +08:00
find_package(Vulkan ${Vulkan_MIN_VERSION} REQUIRED)
2023-05-09 08:12:23 +08:00
find_package(Threads REQUIRED)
+find_package(glslang CONFIG REQUIRED)
2024-03-12 07:38:39 +08:00
2024-04-22 22:18:02 +08:00
# Set the instrumentation level to compile into sources
set(VSG_MAX_INSTRUMENTATION_LEVEL 1 CACHE STRING "Set the instrumentation level to build into the VSG ibrary, 0 for off, 1 coarse grained, 2 medium, 3 fine grained." )
2023-05-09 08:12:23 +08:00
# Enable/disable shader compilation support that pulls in glslang
set(VSG_SUPPORTS_ShaderCompiler 1 CACHE STRING "Optional shader compiler support, 0 for off, 1 for enabled." )
-if (VSG_SUPPORTS_ShaderCompiler)
+if (FALSE)
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/build_vars.cmake)
if (Git_FOUND)
diff --git a/src/vsg/CMakeLists.txt b/src/vsg/CMakeLists.txt
2024-04-22 22:18:02 +08:00
index 36597e0f..9f8cd47e 100644
2023-05-09 08:12:23 +08:00
--- a/src/vsg/CMakeLists.txt
+++ b/src/vsg/CMakeLists.txt
2024-04-22 22:18:02 +08:00
@@ -254,7 +254,7 @@ set(SOURCES
utils/Profiler.cpp
2023-05-09 08:12:23 +08:00
)
-if (${VSG_SUPPORTS_ShaderCompiler})
+if (FALSE)
# include glslang source code directly into the VulkanScenegraph library build.
include(../glslang/build_vars.cmake)
2024-04-22 22:18:02 +08:00
@@ -264,6 +264,10 @@ endif()
2024-03-12 07:38:39 +08:00
set(LIBRARIES PUBLIC
Vulkan::Vulkan
Threads::Threads
+ PRIVATE
2023-05-09 08:12:23 +08:00
+ glslang::glslang
+ glslang::glslang-default-resource-limits
+ glslang::SPIRV
)
2024-03-12 07:38:39 +08:00
# Check for std::atomic
2024-04-22 22:18:02 +08:00
@@ -402,9 +406,6 @@ target_include_directories(vsg
2023-05-09 08:12:23 +08:00
PUBLIC
$<BUILD_INTERFACE:${VSG_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${VSG_BINARY_DIR}/include>
- PRIVATE
- $<BUILD_INTERFACE:${VSG_SOURCE_DIR}/src/glslang>
- $<BUILD_INTERFACE:${GLSLANG_GENERATED_INCLUDEDIR}>
)
target_link_libraries(vsg ${LIBRARIES})
diff --git a/src/vsg/utils/ShaderCompiler.cpp b/src/vsg/utils/ShaderCompiler.cpp
2024-04-22 22:18:02 +08:00
index a8f8dec9..2ca86f87 100644
2023-05-09 08:12:23 +08:00
--- a/src/vsg/utils/ShaderCompiler.cpp
+++ b/src/vsg/utils/ShaderCompiler.cpp
@@ -20,7 +20,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#include <vsg/utils/ShaderCompiler.h>
#if VSG_SUPPORTS_ShaderCompiler
-# include <SPIRV/GlslangToSpv.h>
+# include <glslang/SPIRV/GlslangToSpv.h>
# include <glslang/Public/ResourceLimits.h>
# include <glslang/Public/ShaderLang.h>
#endif
2023-06-13 07:54:44 +08:00
diff --git a/src/vsg/vsgConfig.cmake.in b/src/vsg/vsgConfig.cmake.in
index 7ea0de02..4f7e77bd 100644
--- a/src/vsg/vsgConfig.cmake.in
+++ b/src/vsg/vsgConfig.cmake.in
@@ -2,6 +2,7 @@ include(CMakeFindDependencyMacro)
find_package(Vulkan @Vulkan_MIN_VERSION@ REQUIRED)
find_dependency(Threads)
+find_dependency(glslang)
@FIND_DEPENDENCY_WINDOWING@
include("${CMAKE_CURRENT_LIST_DIR}/vsgTargets.cmake")