1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Revert "SCons: Add CPPEXTPATH for external includes"

(cherry picked from commit b17aa3343a)
This commit is contained in:
Thaddeus Crews
2025-10-06 11:52:22 -05:00
committed by Rémi Verschelde
parent 0e179c0e5c
commit 3ac14dfe01
55 changed files with 225 additions and 152 deletions

View File

@@ -16,7 +16,7 @@ msdfgen_enabled = "msdfgen" in env.module_list
if "svg" in env.module_list:
env_text_server_adv.Prepend(
CPPEXTPATH=[
CPPPATH=[
"#thirdparty/thorvg/inc",
"#thirdparty/thorvg/src/common",
"#thirdparty/thorvg/src/renderer",
@@ -120,11 +120,11 @@ if env["builtin_harfbuzz"]:
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_harfbuzz.Prepend(CPPEXTPATH=["#thirdparty/harfbuzz/src"])
env_harfbuzz.Prepend(CPPPATH=["#thirdparty/harfbuzz/src"])
env_harfbuzz.Append(CCFLAGS=["-DHAVE_ICU"])
if env["builtin_icu4c"]:
env_harfbuzz.Prepend(CPPEXTPATH=["#thirdparty/icu4c/common/", "#thirdparty/icu4c/i18n/"])
env_harfbuzz.Prepend(CPPPATH=["#thirdparty/icu4c/common/", "#thirdparty/icu4c/i18n/"])
env_harfbuzz.Append(
CCFLAGS=[
"-DU_STATIC_IMPLEMENTATION",
@@ -147,15 +147,14 @@ if env["builtin_harfbuzz"]:
]
)
if env["builtin_freetype"]:
env_harfbuzz.Prepend(CPPEXTPATH=["#thirdparty/freetype/include"])
env_harfbuzz.Prepend(CPPPATH=["#thirdparty/freetype/include"])
if env["builtin_graphite"] and env["graphite"]:
env_harfbuzz.Prepend(CPPEXTPATH=["#thirdparty/graphite/include"])
env_harfbuzz.Prepend(CPPPATH=["#thirdparty/graphite/include"])
env_harfbuzz.Append(CCFLAGS=["-DGRAPHITE2_STATIC"])
if env["platform"] in ["android", "linuxbsd", "web"]:
env_harfbuzz.Append(CCFLAGS=["-DHAVE_PTHREAD"])
env_text_server_adv.Prepend(CPPEXTPATH=["#thirdparty/harfbuzz/src"])
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/harfbuzz/src"])
lib = env_harfbuzz.add_library("harfbuzz_builtin", thirdparty_sources)
thirdparty_obj += lib
@@ -218,7 +217,7 @@ if env["builtin_graphite"] and freetype_enabled and env["graphite"]:
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_graphite.Prepend(CPPEXTPATH=["#thirdparty/graphite/src", "#thirdparty/graphite/include"])
env_graphite.Prepend(CPPPATH=["#thirdparty/graphite/src", "#thirdparty/graphite/include"])
env_graphite.Append(
CCFLAGS=[
"-DGRAPHITE2_STATIC",
@@ -458,10 +457,17 @@ if env["builtin_icu4c"]:
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
if not env.editor_build:
if env.editor_build:
icudata = env_icu.CommandNoCache(
"#thirdparty/icu4c/icudata.gen.h",
"#thirdparty/icu4c/icudt_godot.dat",
env.Run(text_server_adv_builders.make_icu_data),
)
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/icu4c/"])
else:
thirdparty_sources += ["icu_data/icudata_stub.cpp"]
env_icu.Prepend(CPPEXTPATH=["#thirdparty/icu4c/common/", "#thirdparty/icu4c/i18n/"])
env_icu.Prepend(CPPPATH=["#thirdparty/icu4c/common/", "#thirdparty/icu4c/i18n/"])
env_icu.Append(
CXXFLAGS=[
"-DU_STATIC_IMPLEMENTATION",
@@ -490,20 +496,11 @@ if env["builtin_icu4c"]:
if env.editor_build:
env_text_server_adv.Append(CXXFLAGS=["-DICU_STATIC_DATA"])
env_text_server_adv.Prepend(CPPEXTPATH=["#thirdparty/icu4c/common/", "#thirdparty/icu4c/i18n/"])
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/icu4c/common/", "#thirdparty/icu4c/i18n/"])
lib = env_icu.add_library("icu_builtin", thirdparty_sources)
thirdparty_obj += lib
if env.editor_build:
icudata = env_icu.CommandNoCache(
"#thirdparty/icu4c/icudata.gen.h",
"#thirdparty/icu4c/icudt_godot.dat",
env.Run(text_server_adv_builders.make_icu_data),
)
env_text_server_adv.Prepend(CPPEXTPATH=["#thirdparty/icu4c/"])
env_icu.Depends(lib, icudata)
# 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")
@@ -523,15 +520,19 @@ if env["builtin_icu4c"]:
module_obj = []
if env["builtin_msdfgen"] and msdfgen_enabled:
# Treat msdfgen headers as system headers to avoid raising warnings. Not supported on MSVC.
env_text_server_adv.Append(CPPDEFINES=[("MSDFGEN_PUBLIC", "")])
env_text_server_adv.Prepend(CPPEXTPATH=["#thirdparty/msdfgen"])
if not env.msvc:
env_text_server_adv.Append(CPPFLAGS=["-isystem", Dir("#thirdparty/msdfgen").path])
else:
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/msdfgen"])
if env["builtin_freetype"] and freetype_enabled:
env_text_server_adv.Append(CPPDEFINES=["FT_CONFIG_OPTION_USE_BROTLI"])
env_text_server_adv.Prepend(CPPEXTPATH=["#thirdparty/freetype/include"])
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/freetype/include"])
if env["builtin_graphite"] and freetype_enabled and env["graphite"]:
env_text_server_adv.Prepend(CPPEXTPATH=["#thirdparty/graphite/include"])
env_text_server_adv.Prepend(CPPPATH=["#thirdparty/graphite/include"])
env_text_server_adv.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj