godot-xterm/addons/godot_xterm/native/SConstruct

52 lines
1.4 KiB
Python
Raw Permalink Normal View History

#!/usr/bin/env python
# SPDX-FileCopyrightText: 2020-2024 Leroy Hopson <godot-xterm@leroy.nix.nz>
# SPDX-License-Identifier: MIT
import os
env = SConscript("thirdparty/godot-cpp/SConstruct")
env['ENV'] = os.environ
VariantDir('build', 'src', duplicate=0)
env['OBJPREFIX'] = os.path.join('build', '')
env.Append(CPPPATH=[
"thirdparty/libtsm/src/tsm",
"thirdparty/libtsm/external",
"thirdparty/libtsm/src/shared",
2024-02-24 07:47:12 +01:00
'thirdparty/libuv/src',
'thirdparty/libuv/include',
])
2021-06-07 08:53:43 +02:00
sources = Glob("src/*.cpp") + Glob("thirdparty/libtsm/src/tsm/*.c")
sources.append([
'thirdparty/libtsm/external/wcwidth/wcwidth.c',
'thirdparty/libtsm/src/shared/shl-htable.c',
])
2024-02-24 07:47:12 +01:00
if env['platform'] == 'linux' or env['platform'] == 'macos':
env.Append(LIBS=['util', env.File('thirdparty/libuv/build/libuv_a.a')])
else:
env.Append(CPPDEFINES=['_PTY_DISABLED'])
if env["platform"] == "macos":
library = env.SharedLibrary(
"bin/libgodot-xterm.{}.{}.framework/libgodot-xterm.{}.{}".format(
env["platform"], env["target"], env["platform"], env["target"]
),
source=sources,
)
2024-02-24 07:47:12 +01:00
spawn_helper = env.Program(
"bin/spawn-helper",
source="thirdparty/node-pty/src/unix/spawn-helper.cc"
)
Default(spawn_helper)
else:
library = env.SharedLibrary(
"bin/libgodot-xterm{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
source=sources,
)
Default(library)