diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-03-28 10:28:08 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-03-28 11:06:49 +0300 |
commit | 40b0634b34efd5ca4f17ef1edf4d18a8edee9819 (patch) | |
tree | e35922124e0ef835cfdc286c2bb96f3edc761128 | |
parent | 097b81f1476a334cd5b00f97f9cd1e32d69851f1 (diff) |
Fix TextServer build with `builtin_icu=no`.
-rw-r--r-- | modules/text_server_adv/SCsub | 73 | ||||
-rw-r--r-- | modules/text_server_fb/SCsub | 18 |
2 files changed, 31 insertions, 60 deletions
diff --git a/modules/text_server_adv/SCsub b/modules/text_server_adv/SCsub index e999700d55..dfd3bb3f1e 100644 --- a/modules/text_server_adv/SCsub +++ b/modules/text_server_adv/SCsub @@ -37,7 +37,7 @@ def make_icu_data(target, source, env): thirdparty_obj = [] freetype_enabled = env.module_check_dependencies("text_server_adv", ["freetype"], True) -msdngen_enabled = env.module_check_dependencies("text_server_adv", ["msdfgen"], True) +msdfgen_enabled = env.module_check_dependencies("text_server_adv", ["msdfgen"], True) if env["builtin_harfbuzz"]: env_harfbuzz = env_modules.Clone() @@ -117,20 +117,25 @@ if env["builtin_harfbuzz"]: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_harfbuzz.Append( - CPPPATH=[ - "#thirdparty/harfbuzz/src", - "#thirdparty/icu4c/common/", - ] - ) + env_harfbuzz.Append(CPPPATH=["#thirdparty/harfbuzz/src"]) + + env_harfbuzz.Append(CCFLAGS=["-DHAVE_ICU"]) + if env["builtin_icu"]: + env_harfbuzz.Append(CPPPATH=["#thirdparty/icu4c/common/"]) + env_harfbuzz.Append(CCFLAGS=["-DHAVE_ICU_BUILTIN"]) if freetype_enabled: env_harfbuzz.Append( - CPPPATH=[ - "#thirdparty/freetype/include", - "#thirdparty/graphite/include", + CCFLAGS=[ + "-DHAVE_FREETYPE", + "-DHAVE_GRAPHITE2", ] ) + if env["builtin_freetype"]: + env_harfbuzz.Append(CPPPATH=["#thirdparty/freetype/include"]) + if env["builtin_graphite"]: + env_harfbuzz.Append(CPPPATH=["#thirdparty/graphite/include"]) + env_harfbuzz.Append(CCFLAGS=["-DGRAPHITE2_STATIC"]) if env["platform"] == "android" or env["platform"] == "linuxbsd": env_harfbuzz.Append(CCFLAGS=["-DHAVE_PTHREAD"]) @@ -141,21 +146,7 @@ if env["builtin_harfbuzz"]: else: env_harfbuzz.Append(CCFLAGS=["-DHB_NO_MT"]) - env_harfbuzz.Append( - CCFLAGS=[ - "-DHAVE_ICU_BUILTIN", - "-DHAVE_ICU", - ] - ) - - if freetype_enabled: - env_harfbuzz.Append( - CCFLAGS=[ - "-DHAVE_FREETYPE", - "-DHAVE_GRAPHITE2", - "-DGRAPHITE2_STATIC", - ] - ) + env_text_server_adv.Append(CPPPATH=["#thirdparty/harfbuzz/src"]) lib = env_harfbuzz.add_library("harfbuzz_builtin", thirdparty_sources) thirdparty_obj += lib @@ -481,6 +472,10 @@ if env["builtin_icu"]: "-DICU_DATA_NAME=" + icu_data_name, ] ) + if env_text_server_adv["tools"]: + env_text_server_adv.Append(CXXFLAGS=["-DICU_STATIC_DATA"]) + + env_text_server_adv.Append(CPPPATH=["#thirdparty/icu4c/common/"]) lib = env_icu.add_library("icu_builtin", thirdparty_sources) thirdparty_obj += lib @@ -503,30 +498,14 @@ if env["builtin_icu"]: module_obj = [] -if env_text_server_adv["tools"]: - env_text_server_adv.Append(CXXFLAGS=["-DICU_STATIC_DATA"]) +if env["builtin_msdfgen"] and msdfgen_enabled: + env_text_server_adv.Append(CPPPATH=["#thirdparty/msdfgen"]) -env_text_server_adv.Append( - CPPPATH=[ - "#thirdparty/harfbuzz/src", - "#thirdparty/icu4c/common/", - ] -) +if env["builtin_freetype"] and freetype_enabled: + env_text_server_adv.Append(CPPPATH=["#thirdparty/freetype/include"]) -if msdngen_enabled: - env_text_server_adv.Append( - CPPPATH=[ - "#thirdparty/msdfgen", - ] - ) - -if freetype_enabled: - env_text_server_adv.Append( - CPPPATH=[ - "#thirdparty/freetype/include", - "#thirdparty/graphite/include", - ] - ) +if env["builtin_graphite"] and freetype_enabled: + env_text_server_adv.Append(CPPPATH=["#thirdparty/graphite/include"]) env_text_server_adv.add_source_files(module_obj, "*.cpp") env.modules_sources += module_obj diff --git a/modules/text_server_fb/SCsub b/modules/text_server_fb/SCsub index 31d1db6167..121f38fcd5 100644 --- a/modules/text_server_fb/SCsub +++ b/modules/text_server_fb/SCsub @@ -4,22 +4,14 @@ Import("env") Import("env_modules") freetype_enabled = env.module_check_dependencies("text_server_fb", ["freetype"], True) -msdngen_enabled = env.module_check_dependencies("text_server_fb", ["msdfgen"], True) +msdfgen_enabled = env.module_check_dependencies("text_server_fb", ["msdfgen"], True) env_text_server_fb = env_modules.Clone() -if msdngen_enabled: - env_text_server_fb.Append( - CPPPATH=[ - "#thirdparty/msdfgen", - ] - ) +if env["builtin_msdfgen"] and msdfgen_enabled: + env_text_server_fb.Append(CPPPATH=["#thirdparty/msdfgen"]) -if freetype_enabled: - env_text_server_fb.Append( - CPPPATH=[ - "#thirdparty/freetype/include", - ] - ) +if env["builtin_freetype"] and freetype_enabled: + env_text_server_fb.Append(CPPPATH=["#thirdparty/freetype/include"]) env_text_server_fb.add_source_files(env.modules_sources, "*.cpp") |