diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f23fc622..396d21043 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,12 @@ if(KOMPUTE_OPT_CODE_COVERAGE) ${CODECOV_DIR}html/) endif() +# If glslang is cloned, then SPIRV/GlslangToSpv.h will be used instead of glslang/SPIRV/GlslangToSpv.h +# As after installation, SPIRV/ header files will be found in glslang/SPIRV/ , more info in #193 +if(KOMPUTE_OPT_REPO_SUBMODULE_BUILD) + add_definitions(-DUSE_EXTERNAL_GLSLANG) +endif() + # Allow scripts to call main kompute Makefile function(kompute_make KOMPUTE_MAKE_TARGET) add_custom_target(${KOMPUTE_MAKE_TARGET} diff --git a/single_include/kompute/Kompute.hpp b/single_include/kompute/Kompute.hpp index 0093eddc1..60a85e653 100755 --- a/single_include/kompute/Kompute.hpp +++ b/single_include/kompute/Kompute.hpp @@ -729,7 +729,12 @@ extern py::object kp_debug, kp_info, kp_warning, kp_error; #include #include +#ifdef USE_EXTERNAL_GLSLANG #include +#else +#include +#endif + #include #include diff --git a/src/include/kompute/Shader.hpp b/src/include/kompute/Shader.hpp index 2cd240424..d670d63a7 100644 --- a/src/include/kompute/Shader.hpp +++ b/src/include/kompute/Shader.hpp @@ -4,7 +4,12 @@ #include #include +#ifdef USE_EXTERNAL_GLSLANG #include +#else +#include +#endif + #include #include