#!/usr/bin/env python # SPDX-FileCopyrightText: 2020-2024 Leroy Hopson # 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", 'thirdparty/libuv/src', 'thirdparty/libuv/include', ]) 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', ]) if env['platform'] == 'linux' or env['platform'] == 'macos': env.Append(LIBS=['util', env.File('thirdparty/libuv/build/libuv_a.a')]) else: env.Append(LIBS=['ws2_32.lib', 'Advapi32', 'User32', 'Userenv', 'iphlpapi']) if env["target"] == "template_release": env.Append(LIBS=[env.File('thirdparty/libuv/build/Release/uv_a.lib')]) else: env.Append(LIBS=[env.File('thirdparty/libuv/build/Debug/uv_a.lib')]) # TODO(ast) this is a bandaid fix (see https://stackoverflow.com/questions/3007312/resolving-lnk4098-defaultlib-msvcrt-conflicts-with) # TODO(ast) a release build needs to use msvcrt instead of msvcrtd env.Append(LINKFLAGS=['/VERBOSE:LIB', '/NODEFAULTLIB:libcmtd.lib', '/NODEFAULTLIB:libcmt.lib', '/NODEFAULTLIB:msvcrt.lib']) if env["platform"] == "macos": library = env.SharedLibrary( "bin/libgodot-xterm.{}.{}.framework/libgodot-xterm.{}.{}".format( env["platform"], env["target"], env["platform"], env["target"] ), source=sources, ) 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)