mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-22 09:40:25 +01:00
Add disable_pty compile option
If disable_pty=yes then the PTY node and dependencies (LibuvUtils, Pipe) will be excluded. On platforms where the PTY node is not supported (e.g. HTML5), this will always be equivalent to `disable_pty=yes`.
This commit is contained in:
parent
29ff3efc49
commit
44ea56aa0f
2 changed files with 12 additions and 2 deletions
|
@ -62,6 +62,11 @@ opts.Add(EnumVariable(
|
|||
allowed_values=('debug', 'release'),
|
||||
ignorecase=2
|
||||
))
|
||||
opts.Add(BoolVariable(
|
||||
'disable_pty',
|
||||
'Disables the PTY and its dependencies (LibuvUtils and Pipe). Has no effect on platforms where PTY is not supported',
|
||||
False
|
||||
))
|
||||
|
||||
opts.Update(env)
|
||||
Help(opts.GenerateHelpText(env))
|
||||
|
@ -258,8 +263,11 @@ sources = []
|
|||
sources.append('src/libgodotxtermnative.cpp')
|
||||
sources.append('src/terminal.cpp')
|
||||
|
||||
|
||||
# PTY not supported on HTML5 or Windows (yet).
|
||||
if env['platform'] != 'javascript' and env['platform'] != 'windows':
|
||||
if env['disable_pty'] or env['platform'] == 'javascript' or env['platform'] == 'windows':
|
||||
env.Append(CPPDEFINES=['_PTY_DISABLED'])
|
||||
else:
|
||||
sources.append('src/pipe.cpp')
|
||||
sources.append('src/libuv_utils.cpp')
|
||||
sources.append('src/node_pty/unix/pty.cc')
|
||||
|
|
|
@ -18,9 +18,11 @@ godot_gdnative_terminate(godot_gdnative_terminate_options *o) {
|
|||
extern "C" void GDN_EXPORT godot_nativescript_init(void *handle) {
|
||||
godot::Godot::nativescript_init(handle);
|
||||
godot::register_tool_class<godot::Terminal>();
|
||||
#if !defined(__EMSCRIPTEN__) && !defined(__WIN32)
|
||||
#if !defined(_PTY_DISABLED)
|
||||
godot::register_tool_class<godot::Pipe>();
|
||||
godot::register_tool_class<godot::LibuvUtils>();
|
||||
#if defined(__unix__)
|
||||
godot::register_tool_class<godot::PTYUnix>();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue