2017-08-19 10:21:24 +08:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
Import('env')
|
2017-08-27 00:53:49 +08:00
|
|
|
from compat import isbasestring
|
2017-08-19 10:21:24 +08:00
|
|
|
|
|
|
|
# Thirdparty source files
|
2017-08-27 19:32:23 +08:00
|
|
|
thirdparty_dir = "#thirdparty/nanosvg/"
|
2017-08-19 10:21:24 +08:00
|
|
|
thirdparty_sources = [
|
|
|
|
"nanosvg.cc"
|
|
|
|
]
|
|
|
|
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
|
|
|
|
|
|
|
# env.add_source_files(env.modules_sources, thirdparty_sources)
|
|
|
|
|
2017-11-29 04:27:57 +08:00
|
|
|
lib = env.add_library("svg_builtin", thirdparty_sources)
|
2017-11-27 21:39:05 +08:00
|
|
|
|
2017-08-19 10:21:24 +08:00
|
|
|
# Needs to be appended to arrive after libscene in the linker call,
|
|
|
|
# but we don't want it to arrive *after* system libs, so manual hack
|
|
|
|
# LIBS contains first SCons Library objects ("SCons.Node.FS.File object")
|
|
|
|
# and then plain strings for system library. We insert between the two.
|
|
|
|
inserted = False
|
|
|
|
for idx, linklib in enumerate(env["LIBS"]):
|
2017-08-27 00:53:49 +08:00
|
|
|
if isbasestring(linklib): # first system lib such as "X11", otherwise SCons lib object
|
2017-08-19 10:21:24 +08:00
|
|
|
env["LIBS"].insert(idx, lib)
|
|
|
|
inserted = True
|
|
|
|
break
|
|
|
|
if not inserted:
|
|
|
|
env.Append(LIBS=[lib])
|
|
|
|
|
|
|
|
env.Append(CPPPATH=[thirdparty_dir])
|
|
|
|
env.Append(CCFLAGS=["-DSVG_ENABLED"])
|
|
|
|
|
|
|
|
# Godot's own source files
|
|
|
|
env.add_source_files(env.modules_sources, "*.cpp")
|
|
|
|
|
2017-08-27 19:32:23 +08:00
|
|
|
Export('env')
|