summaryrefslogtreecommitdiff
path: root/modules/freetype
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2016-10-14 21:57:43 +0200
committerRémi Verschelde <rverschelde@gmail.com>2016-10-15 18:10:17 +0200
commitedbc0c0d0bed169b3c07ef0f504b97936f0dab37 (patch)
treea59bc0448e8f43ce047a0637adc0765b07b05ae0 /modules/freetype
parente6dc51a0f764dcd7cd07482c022c1e92e6a4da3d (diff)
freetype: Make it a module and split thirdparty library
Comment out the weird workaround for building on Windows at it might not be needed anymore. Testing needed to confirm.
Diffstat (limited to 'modules/freetype')
-rw-r--r--modules/freetype/SCsub88
-rw-r--r--modules/freetype/config.py6
-rw-r--r--modules/freetype/register_types.cpp33
-rw-r--r--modules/freetype/register_types.h30
-rw-r--r--modules/freetype/winrtdef.h32
5 files changed, 189 insertions, 0 deletions
diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub
new file mode 100644
index 0000000000..10c58558a5
--- /dev/null
+++ b/modules/freetype/SCsub
@@ -0,0 +1,88 @@
+Import('env')
+
+# Not building in a separate env as core needs it
+
+# Thirdparty source files
+if (env["freetype"] != "system"): # builtin
+ thirdparty_dir = "#thirdparty/freetype/"
+ thirdparty_sources = [
+ "src/autofit/autofit.c",
+ "src/base/ftapi.c",
+ "src/base/ftbase.c",
+ "src/base/ftbbox.c",
+ "src/base/ftbdf.c",
+ "src/base/ftbitmap.c",
+ "src/base/ftcid.c",
+ "src/base/ftdebug.c",
+ "src/base/ftfntfmt.c",
+ "src/base/ftfstype.c",
+ "src/base/ftgasp.c",
+ "src/base/ftglyph.c",
+ "src/base/ftgxval.c",
+ "src/base/ftinit.c",
+ "src/base/ftlcdfil.c",
+ "src/base/ftmm.c",
+ "src/base/ftotval.c",
+ "src/base/ftpatent.c",
+ "src/base/ftpfr.c",
+ "src/base/ftpic.c",
+ "src/base/ftstroke.c",
+ "src/base/ftsynth.c",
+ "src/base/ftsystem.c",
+ "src/base/fttype1.c",
+ "src/base/ftwinfnt.c",
+ "src/bdf/bdf.c",
+ "src/cache/ftcache.c",
+ "src/cff/cff.c",
+ "src/cid/type1cid.c",
+ "src/gxvalid/gxvalid.c",
+ "src/otvalid/otvalid.c",
+ "src/pcf/pcf.c",
+ "src/pfr/pfr.c",
+ "src/psaux/psaux.c",
+ "src/pshinter/pshinter.c",
+ "src/psnames/psnames.c",
+ "src/raster/raster.c",
+ "src/sfnt/sfnt.c",
+ "src/smooth/smooth.c",
+ "src/truetype/truetype.c",
+ "src/type1/type1.c",
+ "src/type42/type42.c",
+ "src/winfonts/winfnt.c",
+ ]
+ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+
+ # Include header for WinRT to fix build issues
+ if "platform" in env and env["platform"] == "winrt":
+ env.Append(CCFLAGS = ['/FI', '"modules/freetype/winrtdef.h"'])
+
+ env.Append(CPPPATH = [thirdparty_dir, thirdparty_dir + "/include"])
+
+ # also requires libpng headers
+ if (env["libpng"] != "system"): # builtin
+ env.Append(CPPPATH = ["#thirdparty/libpng"])
+
+ """ FIXME: Remove this commented code if Windows can handle the monolithic lib
+ # fix for Windows' shell miserably failing on long lines, split in two libraries
+ half1 = []
+ half2 = []
+ for x in thirdparty_sources:
+ if (x.find("src/base") != -1 and x.find("src/sfnt") != -1):
+ half1.append(x)
+ else:
+ half2.append(x)
+
+ lib = env.Library("freetype_builtin1", half2)
+ env.Append(LIBS = [lib])
+ lib = env.Library("freetype_builtin2", half1)
+ env.Append(LIBS = [lib])
+ """
+
+ lib = env.Library("freetype_builtin", thirdparty_sources)
+ env.Append(LIBS = [lib])
+
+# Godot source files
+env.add_source_files(env.modules_sources, "*.cpp")
+env.Append(CCFLAGS = ['-DFREETYPE_ENABLED'])
+
+Export('env')
diff --git a/modules/freetype/config.py b/modules/freetype/config.py
new file mode 100644
index 0000000000..368e97e152
--- /dev/null
+++ b/modules/freetype/config.py
@@ -0,0 +1,6 @@
+
+def can_build(platform):
+ return True
+
+def configure(env):
+ pass
diff --git a/modules/freetype/register_types.cpp b/modules/freetype/register_types.cpp
new file mode 100644
index 0000000000..2b9f47f54c
--- /dev/null
+++ b/modules/freetype/register_types.cpp
@@ -0,0 +1,33 @@
+/*************************************************************************/
+/* register_types.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+#include "register_types.h"
+
+void register_freetype_types() {}
+
+void unregister_freetype_types() {}
diff --git a/modules/freetype/register_types.h b/modules/freetype/register_types.h
new file mode 100644
index 0000000000..326cd2e6ea
--- /dev/null
+++ b/modules/freetype/register_types.h
@@ -0,0 +1,30 @@
+/*************************************************************************/
+/* register_types.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+void register_freetype_types();
+void unregister_freetype_types();
diff --git a/modules/freetype/winrtdef.h b/modules/freetype/winrtdef.h
new file mode 100644
index 0000000000..69c6baf532
--- /dev/null
+++ b/modules/freetype/winrtdef.h
@@ -0,0 +1,32 @@
+/*************************************************************************/
+/* winrtdef.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+// "generic" is a reserved keyword in C++/CX code
+// this avoids the errors in the variable name from Freetype code
+#define generic freetype_generic