Work on slang module compilation

This commit is contained in:
Kovid Goyal 2026-06-24 15:01:36 +05:30
parent 50eb2c13f2
commit 9f85dfd6cc
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 12 additions and 1 deletions

View file

@ -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

View file

@ -6,7 +6,17 @@
*/
#include <Python.h>
#if __has_include("shader-slang/slang.h")
#include <shader-slang/slang.h>
#include <shader-slang/slang-com-ptr.h>
#include <shader-slang/slang-com-helper.h>
#else
#include <slang.h>
#include <slang-com-ptr.h>
#include <slang-com-helper.h>
#endif
using namespace slang;
static char doc[] = "Compile shaders";
static PyMethodDef methods[] = {