mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 18:22:09 +02:00
Stub slang module
This commit is contained in:
19
setup.py
19
setup.py
@@ -630,6 +630,21 @@ def init_env(
|
|||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
|
||||||
|
def slang_env(args: Options) -> Env:
|
||||||
|
ans = env.copy()
|
||||||
|
cflags = []
|
||||||
|
for x in ans.cflags:
|
||||||
|
if x == '-Wstrict-prototypes':
|
||||||
|
continue
|
||||||
|
if x.startswith('-std='):
|
||||||
|
x = '-std=c++20'
|
||||||
|
cflags.append(x)
|
||||||
|
pylib = get_python_flags(args, cflags)
|
||||||
|
ans.cflags = cflags
|
||||||
|
ans.ldflags = pylib + ans.ldflags
|
||||||
|
return ans
|
||||||
|
|
||||||
|
|
||||||
def kitty_env(args: Options) -> Env:
|
def kitty_env(args: Options) -> Env:
|
||||||
ans = env.copy()
|
ans = env.copy()
|
||||||
cflags = ans.cflags
|
cflags = ans.cflags
|
||||||
@@ -1216,6 +1231,10 @@ def build(args: Options, native_optimizations: bool = True, call_init: bool = Tr
|
|||||||
kitty_env(args), 'kitty/fast_data_types', args.compilation_database, sources, headers,
|
kitty_env(args), 'kitty/fast_data_types', args.compilation_database, sources, headers,
|
||||||
build_dsym=args.build_dsym,
|
build_dsym=args.build_dsym,
|
||||||
)
|
)
|
||||||
|
sources, headers = ['shaders/compiler.cpp'], []
|
||||||
|
compile_c_extension(
|
||||||
|
slang_env(args), 'kitty/slangc', args.compilation_database, sources, headers, build_dsym=args.build_dsym
|
||||||
|
)
|
||||||
compile_glfw(args.compilation_database, args.build_dsym)
|
compile_glfw(args.compilation_database, args.build_dsym)
|
||||||
compile_kittens(args)
|
compile_kittens(args)
|
||||||
add_builtin_fonts(args)
|
add_builtin_fonts(args)
|
||||||
|
|||||||
30
shaders/compiler.cpp
Normal file
30
shaders/compiler.cpp
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* compiler.cpp
|
||||||
|
* Copyright (C) 2026 Kovid Goyal <kovid at kovidgoyal.net>
|
||||||
|
*
|
||||||
|
* Distributed under terms of the GPL3 license.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <Python.h>
|
||||||
|
|
||||||
|
|
||||||
|
static char doc[] = "Compile shaders";
|
||||||
|
static PyMethodDef methods[] = {
|
||||||
|
{NULL} /* Sentinel */
|
||||||
|
};
|
||||||
|
|
||||||
|
static int
|
||||||
|
exec_module(PyObject *mod) { (void)mod; return 0; }
|
||||||
|
|
||||||
|
static PyModuleDef_Slot slots[] = { {Py_mod_exec, (void*)exec_module}, {0, NULL} };
|
||||||
|
|
||||||
|
static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT};
|
||||||
|
|
||||||
|
PyObject*
|
||||||
|
PyInit_slangc(void) {
|
||||||
|
module_def.m_name = "slangc";
|
||||||
|
module_def.m_slots = slots;
|
||||||
|
module_def.m_doc = doc;
|
||||||
|
module_def.m_methods = methods;
|
||||||
|
return PyModuleDef_Init(&module_def);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user