diff --git a/setup.py b/setup.py index 1c1f5957f..5a5622703 100755 --- a/setup.py +++ b/setup.py @@ -639,9 +639,10 @@ def slang_env(args: Options) -> Env: if x.startswith('-std='): x = '-std=c++20' cflags.append(x) + cflags[:0] = pkg_config('slang-compiler', '--cflags-only-I') pylib = get_python_flags(args, cflags) ans.cflags = cflags - ans.ldflags = pylib + ans.ldflags + ans.ldflags = pylib + ans.ldflags + pkg_config('slang-compiler', '--libs') return ans diff --git a/shaders/compiler.cpp b/shaders/compiler.cpp index b5b451276..e7afbe05f 100644 --- a/shaders/compiler.cpp +++ b/shaders/compiler.cpp @@ -6,7 +6,17 @@ */ #include +#if __has_include("shader-slang/slang.h") +#include +#include +#include +#else +#include +#include +#include +#endif +using namespace slang; static char doc[] = "Compile shaders"; static PyMethodDef methods[] = {