summaryrefslogtreecommitdiff
path: root/modules/svg/SCsub
blob: e12abac8c1cabc6df5ecc72b13dec5c6f6314cf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python

Import('env')
from compat import isbasestring

# Thirdparty source files
thirdparty_dir = "#thirdparty/nanosvg/"
thirdparty_sources = [
		"nanosvg.cc"
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]

# env.add_source_files(env.modules_sources, thirdparty_sources)

lib = env.add_library("svg_builtin", thirdparty_sources)

# 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"]):
    if isbasestring(linklib): # first system lib such as "X11", otherwise SCons lib object
        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")

Export('env')