2020-08-11 09:10:23 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
Import("env")
|
|
|
|
Import("env_modules")
|
|
|
|
|
2020-08-11 09:11:28 +00:00
|
|
|
env_text_server_adv = env_modules.Clone()
|
|
|
|
|
|
|
|
|
|
|
|
def make_icu_data(target, source, env):
|
|
|
|
dst = target[0].srcnode().abspath
|
|
|
|
|
|
|
|
g = open(dst, "w", encoding="utf-8")
|
|
|
|
|
|
|
|
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
|
|
|
|
g.write("/* (C) 2016 and later: Unicode, Inc. and others. */\n")
|
2021-08-22 01:56:25 +00:00
|
|
|
g.write("/* License & terms of use: https://www.unicode.org/copyright.html */\n")
|
2020-08-11 09:11:28 +00:00
|
|
|
g.write("#ifndef _ICU_DATA_H\n")
|
|
|
|
g.write("#define _ICU_DATA_H\n")
|
|
|
|
g.write('#include "unicode/utypes.h"\n')
|
|
|
|
g.write('#include "unicode/udata.h"\n')
|
|
|
|
g.write('#include "unicode/uversion.h"\n')
|
|
|
|
|
|
|
|
f = open(source[0].srcnode().abspath, "rb")
|
|
|
|
buf = f.read()
|
|
|
|
|
|
|
|
g.write('extern "C" U_EXPORT const size_t U_ICUDATA_SIZE = ' + str(len(buf)) + ";\n")
|
|
|
|
g.write('extern "C" U_EXPORT const unsigned char U_ICUDATA_ENTRY_POINT[] = {\n')
|
|
|
|
for i in range(len(buf)):
|
|
|
|
g.write("\t" + str(buf[i]) + ",\n")
|
|
|
|
|
|
|
|
g.write("};\n")
|
|
|
|
g.write("#endif")
|
|
|
|
|
|
|
|
|
2020-12-17 15:01:36 +00:00
|
|
|
# Thirdparty source files
|
|
|
|
|
|
|
|
thirdparty_obj = []
|
2022-08-04 17:11:01 +00:00
|
|
|
freetype_enabled = "freetype" in env.module_list
|
|
|
|
msdfgen_enabled = "msdfgen" in env.module_list
|
2020-12-17 15:01:36 +00:00
|
|
|
|
2022-06-14 07:29:58 +00:00
|
|
|
if "svg" in env.module_list:
|
|
|
|
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/thorvg/inc", "#thirdparty/thorvg/src/lib"])
|
|
|
|
|
2020-08-11 09:10:23 +00:00
|
|
|
if env["builtin_harfbuzz"]:
|
|
|
|
env_harfbuzz = env_modules.Clone()
|
2020-12-17 15:01:36 +00:00
|
|
|
env_harfbuzz.disable_warnings()
|
2020-08-11 09:10:23 +00:00
|
|
|
|
|
|
|
thirdparty_dir = "#thirdparty/harfbuzz/"
|
|
|
|
thirdparty_sources = [
|
|
|
|
"src/hb-aat-layout.cc",
|
|
|
|
"src/hb-aat-map.cc",
|
|
|
|
"src/hb-blob.cc",
|
|
|
|
"src/hb-buffer-serialize.cc",
|
2022-03-02 08:48:37 +00:00
|
|
|
"src/hb-buffer-verify.cc",
|
2020-08-11 09:10:23 +00:00
|
|
|
"src/hb-buffer.cc",
|
2023-02-13 09:44:33 +00:00
|
|
|
# "src/hb-cairo-utils.cc",
|
|
|
|
# "src/hb-cairo.cc",
|
2020-08-11 09:10:23 +00:00
|
|
|
"src/hb-common.cc",
|
2023-02-13 09:44:33 +00:00
|
|
|
# "src/hb-coretext.cc",
|
|
|
|
# "src/hb-directwrite.cc",
|
2020-08-11 09:10:23 +00:00
|
|
|
"src/hb-draw.cc",
|
2023-02-13 09:44:33 +00:00
|
|
|
"src/hb-face-builder.cc",
|
2020-08-11 09:10:23 +00:00
|
|
|
"src/hb-face.cc",
|
|
|
|
"src/hb-fallback-shape.cc",
|
|
|
|
"src/hb-font.cc",
|
2023-02-13 09:44:33 +00:00
|
|
|
# "src/hb-gdi.cc",
|
|
|
|
# "src/hb-glib.cc",
|
|
|
|
# "src/hb-gobject-structs.cc",
|
2020-08-11 09:10:23 +00:00
|
|
|
"src/hb-icu.cc",
|
|
|
|
"src/hb-map.cc",
|
|
|
|
"src/hb-number.cc",
|
|
|
|
"src/hb-ot-cff1-table.cc",
|
|
|
|
"src/hb-ot-cff2-table.cc",
|
|
|
|
"src/hb-ot-color.cc",
|
|
|
|
"src/hb-ot-face.cc",
|
|
|
|
"src/hb-ot-font.cc",
|
|
|
|
"src/hb-ot-layout.cc",
|
|
|
|
"src/hb-ot-map.cc",
|
|
|
|
"src/hb-ot-math.cc",
|
|
|
|
"src/hb-ot-meta.cc",
|
|
|
|
"src/hb-ot-metrics.cc",
|
|
|
|
"src/hb-ot-name.cc",
|
2022-07-04 06:11:15 +00:00
|
|
|
"src/hb-ot-shaper-arabic.cc",
|
|
|
|
"src/hb-ot-shaper-default.cc",
|
|
|
|
"src/hb-ot-shaper-hangul.cc",
|
|
|
|
"src/hb-ot-shaper-hebrew.cc",
|
|
|
|
"src/hb-ot-shaper-indic-table.cc",
|
|
|
|
"src/hb-ot-shaper-indic.cc",
|
|
|
|
"src/hb-ot-shaper-khmer.cc",
|
|
|
|
"src/hb-ot-shaper-myanmar.cc",
|
|
|
|
"src/hb-ot-shaper-syllabic.cc",
|
|
|
|
"src/hb-ot-shaper-thai.cc",
|
|
|
|
"src/hb-ot-shaper-use.cc",
|
|
|
|
"src/hb-ot-shaper-vowel-constraints.cc",
|
2020-08-11 09:10:23 +00:00
|
|
|
"src/hb-ot-shape-fallback.cc",
|
|
|
|
"src/hb-ot-shape-normalize.cc",
|
|
|
|
"src/hb-ot-shape.cc",
|
|
|
|
"src/hb-ot-tag.cc",
|
|
|
|
"src/hb-ot-var.cc",
|
2023-02-13 09:44:33 +00:00
|
|
|
"src/hb-outline.cc",
|
|
|
|
"src/hb-paint-extents.cc",
|
|
|
|
"src/hb-paint.cc",
|
2020-08-11 09:10:23 +00:00
|
|
|
"src/hb-set.cc",
|
|
|
|
"src/hb-shape-plan.cc",
|
|
|
|
"src/hb-shape.cc",
|
|
|
|
"src/hb-shaper.cc",
|
|
|
|
"src/hb-static.cc",
|
|
|
|
"src/hb-style.cc",
|
|
|
|
"src/hb-subset-cff-common.cc",
|
|
|
|
"src/hb-subset-cff1.cc",
|
|
|
|
"src/hb-subset-cff2.cc",
|
|
|
|
"src/hb-subset-input.cc",
|
2023-02-13 09:44:33 +00:00
|
|
|
"src/hb-subset-instancer-solver.cc",
|
2020-08-11 09:10:23 +00:00
|
|
|
"src/hb-subset-plan.cc",
|
2022-03-18 12:50:57 +00:00
|
|
|
"src/hb-subset-repacker.cc",
|
2020-08-11 09:10:23 +00:00
|
|
|
"src/hb-subset.cc",
|
|
|
|
"src/hb-ucd.cc",
|
|
|
|
"src/hb-unicode.cc",
|
2023-02-13 09:44:33 +00:00
|
|
|
# "src/hb-uniscribe.cc",
|
2020-08-11 09:10:23 +00:00
|
|
|
]
|
2021-02-18 13:45:28 +00:00
|
|
|
|
|
|
|
if freetype_enabled:
|
|
|
|
thirdparty_sources += [
|
|
|
|
"src/hb-ft.cc",
|
|
|
|
]
|
2022-08-03 10:38:37 +00:00
|
|
|
if env["graphite"]:
|
|
|
|
thirdparty_sources += [
|
|
|
|
"src/hb-graphite2.cc",
|
|
|
|
]
|
2020-08-11 09:10:23 +00:00
|
|
|
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
|
|
|
|
2022-07-31 19:52:59 +00:00
|
|
|
env_harfbuzz.Prepend(CPPPATH=["#thirdparty/harfbuzz/src"])
|
2022-03-28 07:28:08 +00:00
|
|
|
|
|
|
|
env_harfbuzz.Append(CCFLAGS=["-DHAVE_ICU"])
|
2023-02-16 11:15:16 +00:00
|
|
|
if env["builtin_icu4c"]:
|
2021-11-12 08:12:37 +00:00
|
|
|
env_harfbuzz.Prepend(CPPPATH=["#thirdparty/icu4c/common/", "#thirdparty/icu4c/i18n/"])
|
2022-03-29 05:38:21 +00:00
|
|
|
env_harfbuzz.Append(CCFLAGS=["-DU_HAVE_LIB_SUFFIX=1", "-DU_LIB_SUFFIX_C_NAME=_godot", "-DHAVE_ICU_BUILTIN"])
|
2020-12-17 15:01:36 +00:00
|
|
|
|
2021-02-18 13:45:28 +00:00
|
|
|
if freetype_enabled:
|
|
|
|
env_harfbuzz.Append(
|
2022-03-28 07:28:08 +00:00
|
|
|
CCFLAGS=[
|
|
|
|
"-DHAVE_FREETYPE",
|
2021-02-18 13:45:28 +00:00
|
|
|
]
|
|
|
|
)
|
2022-10-18 15:41:31 +00:00
|
|
|
if env["graphite"]:
|
|
|
|
env_harfbuzz.Append(
|
|
|
|
CCFLAGS=[
|
|
|
|
"-DHAVE_GRAPHITE2",
|
|
|
|
]
|
|
|
|
)
|
2022-03-28 07:28:08 +00:00
|
|
|
if env["builtin_freetype"]:
|
2022-07-31 19:52:59 +00:00
|
|
|
env_harfbuzz.Prepend(CPPPATH=["#thirdparty/freetype/include"])
|
2022-08-03 10:38:37 +00:00
|
|
|
if env["builtin_graphite"] and env["graphite"]:
|
2022-07-31 19:52:59 +00:00
|
|
|
env_harfbuzz.Prepend(CPPPATH=["#thirdparty/graphite/include"])
|
2022-03-28 07:28:08 +00:00
|
|
|
env_harfbuzz.Append(CCFLAGS=["-DGRAPHITE2_STATIC"])
|
2021-02-18 13:45:28 +00:00
|
|
|
|
2022-08-29 13:56:28 +00:00
|
|
|
if env["platform"] in ["android", "linuxbsd", "web"]:
|
2020-08-11 09:10:23 +00:00
|
|
|
env_harfbuzz.Append(CCFLAGS=["-DHAVE_PTHREAD"])
|
|
|
|
|
2022-07-31 19:52:59 +00:00
|
|
|
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/harfbuzz/src"])
|
2021-02-18 13:45:28 +00:00
|
|
|
|
2020-12-17 15:01:36 +00:00
|
|
|
lib = env_harfbuzz.add_library("harfbuzz_builtin", thirdparty_sources)
|
|
|
|
thirdparty_obj += lib
|
2020-08-11 09:10:23 +00: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"]):
|
|
|
|
if isinstance(linklib, (str, bytes)): # 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])
|
|
|
|
|
2020-12-17 15:01:36 +00:00
|
|
|
|
2022-08-03 10:38:37 +00:00
|
|
|
if env["builtin_graphite"] and freetype_enabled and env["graphite"]:
|
2020-08-11 09:10:23 +00:00
|
|
|
env_graphite = env_modules.Clone()
|
2020-12-17 15:01:36 +00:00
|
|
|
env_graphite.disable_warnings()
|
2020-08-11 09:10:23 +00:00
|
|
|
|
|
|
|
thirdparty_dir = "#thirdparty/graphite/"
|
|
|
|
thirdparty_sources = [
|
|
|
|
"src/gr_char_info.cpp",
|
|
|
|
"src/gr_face.cpp",
|
|
|
|
"src/gr_features.cpp",
|
|
|
|
"src/gr_font.cpp",
|
|
|
|
"src/gr_logging.cpp",
|
|
|
|
"src/gr_segment.cpp",
|
|
|
|
"src/gr_slot.cpp",
|
|
|
|
"src/CmapCache.cpp",
|
|
|
|
"src/Code.cpp",
|
|
|
|
"src/Collider.cpp",
|
|
|
|
"src/Decompressor.cpp",
|
|
|
|
"src/Face.cpp",
|
|
|
|
#'src/FileFace.cpp',
|
|
|
|
"src/FeatureMap.cpp",
|
|
|
|
"src/Font.cpp",
|
|
|
|
"src/GlyphCache.cpp",
|
|
|
|
"src/GlyphFace.cpp",
|
|
|
|
"src/Intervals.cpp",
|
|
|
|
"src/Justifier.cpp",
|
|
|
|
"src/NameTable.cpp",
|
|
|
|
"src/Pass.cpp",
|
|
|
|
"src/Position.cpp",
|
|
|
|
"src/Segment.cpp",
|
|
|
|
"src/Silf.cpp",
|
|
|
|
"src/Slot.cpp",
|
|
|
|
"src/Sparse.cpp",
|
|
|
|
"src/TtfUtil.cpp",
|
|
|
|
"src/UtfCodec.cpp",
|
|
|
|
"src/FileFace.cpp",
|
|
|
|
"src/json.cpp",
|
|
|
|
]
|
|
|
|
if not env_graphite.msvc:
|
|
|
|
thirdparty_sources += ["src/direct_machine.cpp"]
|
|
|
|
else:
|
|
|
|
thirdparty_sources += ["src/call_machine.cpp"]
|
|
|
|
|
|
|
|
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
|
|
|
|
2022-07-31 19:52:59 +00:00
|
|
|
env_graphite.Prepend(CPPPATH=["#thirdparty/graphite/src", "#thirdparty/graphite/include"])
|
2020-08-11 09:11:28 +00:00
|
|
|
env_graphite.Append(
|
|
|
|
CCFLAGS=[
|
|
|
|
"-DGRAPHITE2_STATIC",
|
|
|
|
"-DGRAPHITE2_NTRACING",
|
|
|
|
"-DGRAPHITE2_NFILEFACE",
|
|
|
|
]
|
|
|
|
)
|
2020-12-17 15:01:36 +00:00
|
|
|
|
|
|
|
lib = env_graphite.add_library("graphite_builtin", thirdparty_sources)
|
|
|
|
thirdparty_obj += lib
|
2020-08-11 09:10:23 +00: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"]):
|
|
|
|
if isinstance(linklib, (str, bytes)): # 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])
|
|
|
|
|
2020-12-17 15:01:36 +00:00
|
|
|
|
2023-02-16 11:15:16 +00:00
|
|
|
if env["builtin_icu4c"]:
|
2020-08-11 09:10:23 +00:00
|
|
|
env_icu = env_modules.Clone()
|
2020-12-17 15:01:36 +00:00
|
|
|
env_icu.disable_warnings()
|
2020-08-11 09:10:23 +00:00
|
|
|
|
|
|
|
thirdparty_dir = "#thirdparty/icu4c/"
|
|
|
|
thirdparty_sources = [
|
|
|
|
"common/appendable.cpp",
|
|
|
|
"common/bmpset.cpp",
|
|
|
|
"common/brkeng.cpp",
|
|
|
|
"common/brkiter.cpp",
|
|
|
|
"common/bytesinkutil.cpp",
|
|
|
|
"common/bytestream.cpp",
|
|
|
|
"common/bytestrie.cpp",
|
|
|
|
"common/bytestriebuilder.cpp",
|
|
|
|
"common/bytestrieiterator.cpp",
|
|
|
|
"common/caniter.cpp",
|
|
|
|
"common/characterproperties.cpp",
|
|
|
|
"common/chariter.cpp",
|
|
|
|
"common/charstr.cpp",
|
|
|
|
"common/cmemory.cpp",
|
|
|
|
"common/cstr.cpp",
|
|
|
|
"common/cstring.cpp",
|
|
|
|
"common/cwchar.cpp",
|
|
|
|
"common/dictbe.cpp",
|
|
|
|
"common/dictionarydata.cpp",
|
|
|
|
"common/dtintrv.cpp",
|
|
|
|
"common/edits.cpp",
|
2021-10-28 06:15:28 +00:00
|
|
|
"common/emojiprops.cpp",
|
2020-08-11 09:10:23 +00:00
|
|
|
"common/errorcode.cpp",
|
|
|
|
"common/filteredbrk.cpp",
|
|
|
|
"common/filterednormalizer2.cpp",
|
|
|
|
"common/icudataver.cpp",
|
|
|
|
"common/icuplug.cpp",
|
|
|
|
"common/loadednormalizer2impl.cpp",
|
|
|
|
"common/localebuilder.cpp",
|
|
|
|
"common/localematcher.cpp",
|
|
|
|
"common/localeprioritylist.cpp",
|
|
|
|
"common/locavailable.cpp",
|
|
|
|
"common/locbased.cpp",
|
|
|
|
"common/locdispnames.cpp",
|
|
|
|
"common/locdistance.cpp",
|
|
|
|
"common/locdspnm.cpp",
|
|
|
|
"common/locid.cpp",
|
|
|
|
"common/loclikely.cpp",
|
|
|
|
"common/loclikelysubtags.cpp",
|
|
|
|
"common/locmap.cpp",
|
|
|
|
"common/locresdata.cpp",
|
|
|
|
"common/locutil.cpp",
|
|
|
|
"common/lsr.cpp",
|
2021-10-28 06:15:28 +00:00
|
|
|
"common/lstmbe.cpp",
|
2020-08-11 09:10:23 +00:00
|
|
|
"common/messagepattern.cpp",
|
2023-05-23 00:05:01 +00:00
|
|
|
"common/mlbe.cpp",
|
2020-08-11 09:10:23 +00:00
|
|
|
"common/normalizer2.cpp",
|
|
|
|
"common/normalizer2impl.cpp",
|
|
|
|
"common/normlzr.cpp",
|
|
|
|
"common/parsepos.cpp",
|
|
|
|
"common/patternprops.cpp",
|
|
|
|
"common/pluralmap.cpp",
|
|
|
|
"common/propname.cpp",
|
|
|
|
"common/propsvec.cpp",
|
|
|
|
"common/punycode.cpp",
|
|
|
|
"common/putil.cpp",
|
|
|
|
"common/rbbi.cpp",
|
|
|
|
"common/rbbi_cache.cpp",
|
|
|
|
"common/rbbidata.cpp",
|
|
|
|
"common/rbbinode.cpp",
|
|
|
|
"common/rbbirb.cpp",
|
|
|
|
"common/rbbiscan.cpp",
|
|
|
|
"common/rbbisetb.cpp",
|
|
|
|
"common/rbbistbl.cpp",
|
|
|
|
"common/rbbitblb.cpp",
|
|
|
|
"common/resbund.cpp",
|
|
|
|
"common/resbund_cnv.cpp",
|
|
|
|
"common/resource.cpp",
|
|
|
|
"common/restrace.cpp",
|
|
|
|
"common/ruleiter.cpp",
|
|
|
|
"common/schriter.cpp",
|
|
|
|
"common/serv.cpp",
|
|
|
|
"common/servlk.cpp",
|
|
|
|
"common/servlkf.cpp",
|
|
|
|
"common/servls.cpp",
|
|
|
|
"common/servnotf.cpp",
|
|
|
|
"common/servrbf.cpp",
|
|
|
|
"common/servslkf.cpp",
|
|
|
|
"common/sharedobject.cpp",
|
|
|
|
"common/simpleformatter.cpp",
|
|
|
|
"common/static_unicode_sets.cpp",
|
|
|
|
"common/stringpiece.cpp",
|
|
|
|
"common/stringtriebuilder.cpp",
|
|
|
|
"common/uarrsort.cpp",
|
|
|
|
"common/ubidi.cpp",
|
|
|
|
"common/ubidi_props.cpp",
|
|
|
|
"common/ubidiln.cpp",
|
|
|
|
"common/ubiditransform.cpp",
|
|
|
|
"common/ubidiwrt.cpp",
|
|
|
|
"common/ubrk.cpp",
|
|
|
|
"common/ucase.cpp",
|
|
|
|
"common/ucasemap.cpp",
|
|
|
|
"common/ucasemap_titlecase_brkiter.cpp",
|
|
|
|
"common/ucat.cpp",
|
|
|
|
"common/uchar.cpp",
|
|
|
|
"common/ucharstrie.cpp",
|
|
|
|
"common/ucharstriebuilder.cpp",
|
|
|
|
"common/ucharstrieiterator.cpp",
|
|
|
|
"common/uchriter.cpp",
|
|
|
|
"common/ucln_cmn.cpp",
|
|
|
|
"common/ucmndata.cpp",
|
|
|
|
"common/ucnv.cpp",
|
|
|
|
"common/ucnv2022.cpp",
|
|
|
|
"common/ucnv_bld.cpp",
|
|
|
|
"common/ucnv_cb.cpp",
|
|
|
|
"common/ucnv_cnv.cpp",
|
|
|
|
"common/ucnv_ct.cpp",
|
|
|
|
"common/ucnv_err.cpp",
|
|
|
|
"common/ucnv_ext.cpp",
|
|
|
|
"common/ucnv_io.cpp",
|
|
|
|
"common/ucnv_lmb.cpp",
|
|
|
|
"common/ucnv_set.cpp",
|
|
|
|
"common/ucnv_u16.cpp",
|
|
|
|
"common/ucnv_u32.cpp",
|
|
|
|
"common/ucnv_u7.cpp",
|
|
|
|
"common/ucnv_u8.cpp",
|
|
|
|
"common/ucnvbocu.cpp",
|
|
|
|
"common/ucnvdisp.cpp",
|
|
|
|
"common/ucnvhz.cpp",
|
|
|
|
"common/ucnvisci.cpp",
|
|
|
|
"common/ucnvlat1.cpp",
|
|
|
|
"common/ucnvmbcs.cpp",
|
|
|
|
"common/ucnvscsu.cpp",
|
|
|
|
"common/ucnvsel.cpp",
|
|
|
|
"common/ucol_swp.cpp",
|
|
|
|
"common/ucptrie.cpp",
|
|
|
|
"common/ucurr.cpp",
|
|
|
|
"common/udata.cpp",
|
|
|
|
"common/udatamem.cpp",
|
|
|
|
"common/udataswp.cpp",
|
|
|
|
"common/uenum.cpp",
|
|
|
|
"common/uhash.cpp",
|
|
|
|
"common/uhash_us.cpp",
|
|
|
|
"common/uidna.cpp",
|
|
|
|
"common/uinit.cpp",
|
|
|
|
"common/uinvchar.cpp",
|
|
|
|
"common/uiter.cpp",
|
|
|
|
"common/ulist.cpp",
|
|
|
|
"common/uloc.cpp",
|
|
|
|
"common/uloc_keytype.cpp",
|
|
|
|
"common/uloc_tag.cpp",
|
|
|
|
"common/umapfile.cpp",
|
|
|
|
"common/umath.cpp",
|
|
|
|
"common/umutablecptrie.cpp",
|
|
|
|
"common/umutex.cpp",
|
|
|
|
"common/unames.cpp",
|
|
|
|
"common/unifiedcache.cpp",
|
|
|
|
"common/unifilt.cpp",
|
|
|
|
"common/unifunct.cpp",
|
|
|
|
"common/uniset.cpp",
|
|
|
|
"common/uniset_closure.cpp",
|
|
|
|
"common/uniset_props.cpp",
|
|
|
|
"common/unisetspan.cpp",
|
|
|
|
"common/unistr.cpp",
|
|
|
|
"common/unistr_case.cpp",
|
|
|
|
"common/unistr_case_locale.cpp",
|
|
|
|
"common/unistr_cnv.cpp",
|
|
|
|
"common/unistr_props.cpp",
|
|
|
|
"common/unistr_titlecase_brkiter.cpp",
|
|
|
|
"common/unorm.cpp",
|
|
|
|
"common/unormcmp.cpp",
|
|
|
|
"common/uobject.cpp",
|
|
|
|
"common/uprops.cpp",
|
|
|
|
"common/ures_cnv.cpp",
|
|
|
|
"common/uresbund.cpp",
|
|
|
|
"common/uresdata.cpp",
|
|
|
|
"common/usc_impl.cpp",
|
|
|
|
"common/uscript.cpp",
|
|
|
|
"common/uscript_props.cpp",
|
|
|
|
"common/uset.cpp",
|
|
|
|
"common/uset_props.cpp",
|
|
|
|
"common/usetiter.cpp",
|
2020-08-11 09:11:28 +00:00
|
|
|
# "common/ushape.cpp",
|
2020-08-11 09:10:23 +00:00
|
|
|
"common/usprep.cpp",
|
|
|
|
"common/ustack.cpp",
|
|
|
|
"common/ustr_cnv.cpp",
|
|
|
|
"common/ustr_titlecase_brkiter.cpp",
|
|
|
|
"common/ustr_wcs.cpp",
|
|
|
|
"common/ustrcase.cpp",
|
|
|
|
"common/ustrcase_locale.cpp",
|
|
|
|
"common/ustrenum.cpp",
|
|
|
|
"common/ustrfmt.cpp",
|
|
|
|
"common/ustring.cpp",
|
|
|
|
"common/ustrtrns.cpp",
|
|
|
|
"common/utext.cpp",
|
|
|
|
"common/utf_impl.cpp",
|
|
|
|
"common/util.cpp",
|
|
|
|
"common/util_props.cpp",
|
|
|
|
"common/utrace.cpp",
|
|
|
|
"common/utrie.cpp",
|
|
|
|
"common/utrie2.cpp",
|
|
|
|
"common/utrie2_builder.cpp",
|
|
|
|
"common/utrie_swap.cpp",
|
|
|
|
"common/uts46.cpp",
|
|
|
|
"common/utypes.cpp",
|
|
|
|
"common/uvector.cpp",
|
|
|
|
"common/uvectr32.cpp",
|
|
|
|
"common/uvectr64.cpp",
|
|
|
|
"common/wintz.cpp",
|
2021-11-12 08:12:37 +00:00
|
|
|
"i18n/scriptset.cpp",
|
|
|
|
"i18n/ucln_in.cpp",
|
|
|
|
"i18n/uspoof.cpp",
|
|
|
|
"i18n/uspoof_impl.cpp",
|
2020-08-11 09:10:23 +00:00
|
|
|
]
|
|
|
|
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
2020-08-11 09:11:28 +00:00
|
|
|
|
2023-05-23 00:05:01 +00:00
|
|
|
icu_data_name = "icudt73l.dat"
|
2020-08-11 09:11:28 +00:00
|
|
|
|
SCons: Unify tools/target build type configuration
Implements https://github.com/godotengine/godot-proposals/issues/3371.
New `target` presets
====================
The `tools` option is removed and `target` changes to use three new presets,
which match the builds users are familiar with. These targets control the
default optimization level and enable editor-specific and debugging code:
- `editor`: Replaces `tools=yes target=release_debug`.
* Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_debug`: Replaces `tools=no target=release_debug`.
* Defines: `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_release`: Replaces `tools=no target=release`.
* Defines: `-O3`/`/O2`
New `dev_build` option
======================
The previous `target=debug` is now replaced by a separate `dev_build=yes`
option, which can be used in combination with either of the three targets,
and changes the following:
- `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`),
enables generating debug symbols, does not define `NDEBUG` so `assert()`
works in thirdparty libraries, adds a `.dev` suffix to the binary name.
Note: Unlike previously, `dev_build` defaults to off so that users who
compile Godot from source get an optimized and small build by default.
Engine contributors should now set `dev_build=yes` in their build scripts or
IDE configuration manually.
Changed binary names
====================
The name of generated binaries and object files are changed too, to follow
this format:
`godot.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]`
For example:
- `godot.linuxbsd.editor.dev.arm64`
- `godot.windows.template_release.double.x86_64.mono.exe`
Be sure to update your links/scripts/IDE config accordingly.
More flexible `optimize` and `debug_symbols` options
====================================================
The optimization level and whether to generate debug symbols can be further
specified with the `optimize` and `debug_symbols` options. So the default
values listed above for the various `target` and `dev_build` combinations
are indicative and can be replaced when compiling, e.g.:
`scons p=linuxbsd target=template_debug dev_build=yes optimize=debug`
will make a "debug" export template with dev-only code enabled, `-Og`
optimization level for GCC/Clang, and debug symbols. Perfect for debugging
complex crashes at runtime in an exported project.
2022-09-22 06:28:55 +00:00
|
|
|
if env.editor_build:
|
2020-08-11 09:11:28 +00:00
|
|
|
env_icu.Depends("#thirdparty/icu4c/icudata.gen.h", "#thirdparty/icu4c/" + icu_data_name)
|
|
|
|
env_icu.Command("#thirdparty/icu4c/icudata.gen.h", "#thirdparty/icu4c/" + icu_data_name, make_icu_data)
|
2022-07-31 19:52:59 +00:00
|
|
|
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/icu4c/"])
|
2020-08-11 09:11:28 +00:00
|
|
|
else:
|
|
|
|
thirdparty_sources += ["icu_data/icudata_stub.cpp"]
|
2020-08-11 09:10:23 +00:00
|
|
|
|
2021-11-12 08:12:37 +00:00
|
|
|
env_icu.Prepend(CPPPATH=["#thirdparty/icu4c/common/", "#thirdparty/icu4c/i18n/"])
|
2020-08-11 09:10:23 +00:00
|
|
|
env_icu.Append(
|
2020-08-11 09:11:28 +00:00
|
|
|
CXXFLAGS=[
|
|
|
|
"-DU_STATIC_IMPLEMENTATION",
|
|
|
|
"-DU_COMMON_IMPLEMENTATION",
|
|
|
|
"-DUCONFIG_NO_COLLATION",
|
|
|
|
"-DUCONFIG_NO_CONVERSION",
|
|
|
|
"-DUCONFIG_NO_FORMATTING",
|
|
|
|
"-DUCONFIG_NO_SERVICE",
|
|
|
|
"-DUCONFIG_NO_IDNA",
|
|
|
|
"-DUCONFIG_NO_FILE_IO",
|
|
|
|
"-DUCONFIG_NO_TRANSLITERATION",
|
2021-11-12 08:12:37 +00:00
|
|
|
"-DUCONFIG_NO_REGULAR_EXPRESSIONS",
|
2020-08-11 09:11:28 +00:00
|
|
|
"-DPKGDATA_MODE=static",
|
2022-03-29 05:38:21 +00:00
|
|
|
"-DU_ENABLE_DYLOAD=0",
|
|
|
|
"-DU_HAVE_LIB_SUFFIX=1",
|
|
|
|
"-DU_LIB_SUFFIX_C_NAME=_godot",
|
2020-08-11 09:11:28 +00:00
|
|
|
"-DICU_DATA_NAME=" + icu_data_name,
|
|
|
|
]
|
2020-08-11 09:10:23 +00:00
|
|
|
)
|
2020-08-11 09:11:28 +00:00
|
|
|
env_text_server_adv.Append(
|
|
|
|
CXXFLAGS=[
|
2022-03-29 05:38:21 +00:00
|
|
|
"-DU_HAVE_LIB_SUFFIX=1",
|
|
|
|
"-DU_LIB_SUFFIX_C_NAME=_godot",
|
2020-08-11 09:11:28 +00:00
|
|
|
"-DICU_DATA_NAME=" + icu_data_name,
|
|
|
|
]
|
|
|
|
)
|
SCons: Unify tools/target build type configuration
Implements https://github.com/godotengine/godot-proposals/issues/3371.
New `target` presets
====================
The `tools` option is removed and `target` changes to use three new presets,
which match the builds users are familiar with. These targets control the
default optimization level and enable editor-specific and debugging code:
- `editor`: Replaces `tools=yes target=release_debug`.
* Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_debug`: Replaces `tools=no target=release_debug`.
* Defines: `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_release`: Replaces `tools=no target=release`.
* Defines: `-O3`/`/O2`
New `dev_build` option
======================
The previous `target=debug` is now replaced by a separate `dev_build=yes`
option, which can be used in combination with either of the three targets,
and changes the following:
- `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`),
enables generating debug symbols, does not define `NDEBUG` so `assert()`
works in thirdparty libraries, adds a `.dev` suffix to the binary name.
Note: Unlike previously, `dev_build` defaults to off so that users who
compile Godot from source get an optimized and small build by default.
Engine contributors should now set `dev_build=yes` in their build scripts or
IDE configuration manually.
Changed binary names
====================
The name of generated binaries and object files are changed too, to follow
this format:
`godot.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]`
For example:
- `godot.linuxbsd.editor.dev.arm64`
- `godot.windows.template_release.double.x86_64.mono.exe`
Be sure to update your links/scripts/IDE config accordingly.
More flexible `optimize` and `debug_symbols` options
====================================================
The optimization level and whether to generate debug symbols can be further
specified with the `optimize` and `debug_symbols` options. So the default
values listed above for the various `target` and `dev_build` combinations
are indicative and can be replaced when compiling, e.g.:
`scons p=linuxbsd target=template_debug dev_build=yes optimize=debug`
will make a "debug" export template with dev-only code enabled, `-Og`
optimization level for GCC/Clang, and debug symbols. Perfect for debugging
complex crashes at runtime in an exported project.
2022-09-22 06:28:55 +00:00
|
|
|
if env.editor_build:
|
2022-03-28 07:28:08 +00:00
|
|
|
env_text_server_adv.Append(CXXFLAGS=["-DICU_STATIC_DATA"])
|
|
|
|
|
2021-11-12 08:12:37 +00:00
|
|
|
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/icu4c/common/", "#thirdparty/icu4c/i18n/"])
|
2020-08-11 09:11:28 +00:00
|
|
|
|
2020-12-17 15:01:36 +00:00
|
|
|
lib = env_icu.add_library("icu_builtin", thirdparty_sources)
|
|
|
|
thirdparty_obj += lib
|
2020-08-11 09:10:23 +00: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"]):
|
|
|
|
if isinstance(linklib, (str, bytes)): # 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])
|
|
|
|
|
2020-12-17 15:01:36 +00:00
|
|
|
|
|
|
|
# Godot source files
|
|
|
|
|
|
|
|
module_obj = []
|
|
|
|
|
2022-03-28 07:28:08 +00:00
|
|
|
if env["builtin_msdfgen"] and msdfgen_enabled:
|
2023-05-11 10:32:23 +00:00
|
|
|
# Treat msdfgen headers as system headers to avoid raising warnings. Not supported on MSVC.
|
|
|
|
if not env.msvc:
|
|
|
|
env_text_server_adv.Append(CPPFLAGS=["-isystem", Dir("#thirdparty/msdfgen").path])
|
|
|
|
else:
|
|
|
|
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/msdfgen"])
|
2020-08-11 09:11:28 +00:00
|
|
|
|
2022-03-28 07:28:08 +00:00
|
|
|
if env["builtin_freetype"] and freetype_enabled:
|
2022-08-01 09:03:20 +00:00
|
|
|
env_text_server_adv.Append(CPPDEFINES=["FT_CONFIG_OPTION_USE_BROTLI"])
|
2022-07-31 19:52:59 +00:00
|
|
|
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/freetype/include"])
|
2020-12-17 15:01:36 +00:00
|
|
|
|
2022-08-03 10:38:37 +00:00
|
|
|
if env["builtin_graphite"] and freetype_enabled and env["graphite"]:
|
2022-07-31 19:52:59 +00:00
|
|
|
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/graphite/include"])
|
2021-02-18 13:45:28 +00:00
|
|
|
|
2020-12-17 15:01:36 +00:00
|
|
|
env_text_server_adv.add_source_files(module_obj, "*.cpp")
|
|
|
|
env.modules_sources += module_obj
|
|
|
|
|
|
|
|
# Needed to force rebuilding the module files when the thirdparty library is updated.
|
|
|
|
env.Depends(module_obj, thirdparty_obj)
|