summaryrefslogtreecommitdiff
path: root/modules/svg/SCsub
diff options
context:
space:
mode:
authorDaniel J. Ramirez <djrmuv@gmail.com>2017-08-18 21:21:24 -0500
committerDaniel J. Ramirez <djrmuv@gmail.com>2017-08-20 13:53:02 -0500
commitda8fecf25e11ea05ad6aaab4f9676c78e4faecdc (patch)
treef56d429c0bca3b6bfd214e4cbc1a8c481691b43e /modules/svg/SCsub
parentab13d0aeed43b7263b1e62bb62551525b70822a8 (diff)
Added support for SVG
Diffstat (limited to 'modules/svg/SCsub')
-rw-r--r--modules/svg/SCsub34
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/svg/SCsub b/modules/svg/SCsub
new file mode 100644
index 0000000000..0d3a347b7e
--- /dev/null
+++ b/modules/svg/SCsub
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+
+Import('env')
+
+# Thirdparty source files
+thirdparty_dir = "#thirdparty/nanosvg/src/"
+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.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 isinstance(linklib, basestring): # 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') \ No newline at end of file