From d70fa8ca21370e6d4dd52d0ef2a6131b8e0d5945 Mon Sep 17 00:00:00 2001 From: nulano Date: Fri, 11 Sep 2020 07:07:32 +0200 Subject: [PATCH] enable FT_CONFIG_OPTION_USE_HARFBUZZ for windows builds --- winbuild/build_prepare.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/winbuild/build_prepare.py b/winbuild/build_prepare.py index 175595ff5..fca33b13b 100644 --- a/winbuild/build_prepare.py +++ b/winbuild/build_prepare.py @@ -179,7 +179,15 @@ deps = { "MultiThreaded": "MultiThreadedDLL", # noqa: E501 # freetype doesn't specify SDK version, MSBuild may guess incorrectly '': '\n $(WindowsSDKVersion)', # noqa: E501 - } + }, + r"builds\windows\vc2010\freetype.user.props": { + "": "FT_CONFIG_OPTION_USE_HARFBUZZ", # noqa: E501 + "": r"{dir_harfbuzz}\src", # noqa: E501 + }, + r"src/autofit/afshaper.c": { + # link against harfbuzz.lib once it becomes available + "#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ": '#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ\n#pragma comment(lib, "harfbuzz.lib")', # noqa: E501 + }, }, "build": [ cmd_rmdir("objs"), @@ -488,7 +496,7 @@ if __name__ == "__main__": elif arg == "--no-imagequant": disabled += ["libimagequant"] elif arg == "--no-raqm": - disabled += ["harfbuzz", "fribidi", "libraqm"] + disabled += ["fribidi", "libraqm"] elif arg.startswith("--depends="): depends_dir = arg[10:] elif arg.startswith("--python="): @@ -562,6 +570,9 @@ if __name__ == "__main__": "header": sum([header, msvs["header"], ["@echo on"]], []), } + for k, v in deps.items(): + prefs[f"dir_{k}"] = os.path.join(sources_dir, v["dir"]) + print() write_script(".gitignore", ["*"])