[build-system]
requires = [
    "setuptools >= 36.4",
    "wheel",
    "setuptools_scm >= 2.1",
    "cython >= 0.28.1",
]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
# only build for 64-bit
skip = ["*-manylinux_i686", "*-musllinux_i686"]

test-requires = "pytest"
test-command = "pytest {project}/tests"

[tool.cibuildwheel.macos]
archs = ["x86_64", "universal2", "arm64"]
before-all = "brew install ccache"
before-test = "ccache --show-stats"

[tool.cibuildwheel.macos.environment]
CC = "/opt/homebrew/opt/ccache/libexec/cc"

[tool.cibuildwheel.linux]
before-all = [
    "yum install -y ccache",
    "ln -s $(which ccache) /usr/lib64/ccache/gcc",
]
before-test = "ccache --show-stats"

[tool.cibuildwheel.linux.environment]
CC = "/usr/lib64/ccache/gcc"
CFLAGS = "-g0"

[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
before-all = "apk add ccache"
environment = {CC = "/usr/lib/ccache/bin/gcc"}

[tool.black]
extend-exclude = "harfbuzz"
