mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
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.
This commit is contained in:
88
modules/freetype/SCsub
Normal file
88
modules/freetype/SCsub
Normal file
@@ -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')
|
||||
6
modules/freetype/config.py
Normal file
6
modules/freetype/config.py
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
def can_build(platform):
|
||||
return True
|
||||
|
||||
def configure(env):
|
||||
pass
|
||||
33
modules/freetype/register_types.cpp
Normal file
33
modules/freetype/register_types.cpp
Normal file
@@ -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() {}
|
||||
30
modules/freetype/register_types.h
Normal file
30
modules/freetype/register_types.h
Normal file
@@ -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();
|
||||
32
modules/freetype/winrtdef.h
Normal file
32
modules/freetype/winrtdef.h
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user