Skip to content

Commit c236740

Browse files
authored
Merge pull request #4915 from nulano/ft-hb
Winbuild: Enable FT_CONFIG_OPTION_USE_HARFBUZZ
2 parents 93d011e + d70fa8c commit c236740

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

winbuild/build_prepare.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,15 @@ def cmd_msbuild(
179179
"<RuntimeLibrary>MultiThreaded</RuntimeLibrary>": "<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>", # noqa: E501
180180
# freetype doesn't specify SDK version, MSBuild may guess incorrectly
181181
'<PropertyGroup Label="Globals">': '<PropertyGroup Label="Globals">\n <WindowsTargetPlatformVersion>$(WindowsSDKVersion)</WindowsTargetPlatformVersion>', # noqa: E501
182-
}
182+
},
183+
r"builds\windows\vc2010\freetype.user.props": {
184+
"<UserDefines></UserDefines>": "<UserDefines>FT_CONFIG_OPTION_USE_HARFBUZZ</UserDefines>", # noqa: E501
185+
"<UserIncludeDirectories></UserIncludeDirectories>": r"<UserIncludeDirectories>{dir_harfbuzz}\src</UserIncludeDirectories>", # noqa: E501
186+
},
187+
r"src/autofit/afshaper.c": {
188+
# link against harfbuzz.lib once it becomes available
189+
"#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ": '#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ\n#pragma comment(lib, "harfbuzz.lib")', # noqa: E501
190+
},
183191
},
184192
"build": [
185193
cmd_rmdir("objs"),
@@ -488,7 +496,7 @@ def build_pillow():
488496
elif arg == "--no-imagequant":
489497
disabled += ["libimagequant"]
490498
elif arg == "--no-raqm":
491-
disabled += ["harfbuzz", "fribidi", "libraqm"]
499+
disabled += ["fribidi", "libraqm"]
492500
elif arg.startswith("--depends="):
493501
depends_dir = arg[10:]
494502
elif arg.startswith("--python="):
@@ -562,6 +570,9 @@ def build_pillow():
562570
"header": sum([header, msvs["header"], ["@echo on"]], []),
563571
}
564572

573+
for k, v in deps.items():
574+
prefs[f"dir_{k}"] = os.path.join(sources_dir, v["dir"])
575+
565576
print()
566577

567578
write_script(".gitignore", ["*"])

0 commit comments

Comments
 (0)