Skip to content

Commit

Permalink
build brotli on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nulano committed Sep 7, 2022
1 parent 2f95e49 commit e9af622
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ jobs:
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libpng.cmd"

# for FreeType WOFF2 font support
- name: Build dependencies / brotli
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_brotli.cmd"

- name: Build dependencies / FreeType
if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_freetype.cmd"
Expand Down
18 changes: 16 additions & 2 deletions winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,20 @@ def cmd_msbuild(
"headers": [r"png*.h"],
"libs": [r"libpng16.lib"],
},
"brotli": {
"url": "https://github.com/google/brotli/archive/refs/tags/v1.0.9.tar.gz",
"filename": "brotli-1.0.9.tar.gz",
"dir": "brotli-1.0.9",
"license": "LICENSE",
"build": [
cmd_cmake(),
cmd_nmake(target="clean"),
cmd_nmake(target="brotlicommon-static"),
cmd_nmake(target="brotlidec-static"),
cmd_xcopy(r"c\include", "{inc_dir}"),
],
"libs": ["*.lib"],
},
"freetype": {
"url": "https://download.savannah.gnu.org/releases/freetype/freetype-2.12.1.tar.gz", # noqa: E501
"filename": "freetype-2.12.1.tar.gz",
Expand All @@ -255,10 +269,10 @@ def cmd_msbuild(
'<PropertyGroup Label="Globals">': '<PropertyGroup Label="Globals">\n <WindowsTargetPlatformVersion>$(WindowsSDKVersion)</WindowsTargetPlatformVersion>', # noqa: E501
},
r"builds\windows\vc2010\freetype.user.props": {
"<UserDefines></UserDefines>": "<UserDefines>FT_CONFIG_OPTION_SYSTEM_ZLIB;FT_CONFIG_OPTION_USE_PNG;FT_CONFIG_OPTION_USE_HARFBUZZ</UserDefines>", # noqa: E501
"<UserDefines></UserDefines>": "<UserDefines>FT_CONFIG_OPTION_SYSTEM_ZLIB;FT_CONFIG_OPTION_USE_PNG;FT_CONFIG_OPTION_USE_HARFBUZZ;FT_CONFIG_OPTION_USE_BROTLI</UserDefines>", # noqa: E501
"<UserIncludeDirectories></UserIncludeDirectories>": r"<UserIncludeDirectories>{dir_harfbuzz}\src;{inc_dir}</UserIncludeDirectories>", # noqa: E501
"<UserLibraryDirectories></UserLibraryDirectories>": "<UserLibraryDirectories>{lib_dir}</UserLibraryDirectories>", # noqa: E501
"<UserDependencies></UserDependencies>": "<UserDependencies>zlib.lib;libpng16.lib</UserDependencies>", # noqa: E501
"<UserDependencies></UserDependencies>": "<UserDependencies>zlib.lib;libpng16.lib;brotlicommon-static.lib;brotlidec-static.lib</UserDependencies>", # noqa: E501
},
r"src/autofit/afshaper.c": {
# link against harfbuzz.lib
Expand Down

0 comments on commit e9af622

Please sign in to comment.