Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play with meson #156

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
project('foo', 'cython', 'cpp')

py = import('python').find_installation()
dep_py = py.dependency()

harfbuzz_includes = include_directories('harfbuzz/src')
harfbuzz = static_library(
'harfbuzz',
'harfbuzz/src/harfbuzz-subset.cc',
'harfbuzz/src/hb-coretext.cc',
'harfbuzz/src/hb-directwrite.cc',
'harfbuzz/src/hb-uniscribe.cc',
cpp_args: '-DHB_NO_MT=1 -DHB_EXPERIMENTAL_API=1',
include_directories: harfbuzz_includes,
)
Copy link
Collaborator

@khaledhosny khaledhosny Jan 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are going to use meson, why not use harfbuzz as a subproject (or simply as a dependency, so that #45 could be fixed as well).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's the idea, but first I want to get it to actually compile. It still complains about missing hb.h.


py.extension_module(
'uharfbuzz',
'src/uharfbuzz/_harfbuzz.pyx',
dependencies: dep_py,
include_directories: harfbuzz_includes,
install: true,
link_with: [harfbuzz],
override_options: ['cython_language=cpp'],
)
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[build-system]
build-backend = "mesonpy"
requires = [
"setuptools >= 36.4",
"wheel",
"meson-python",
khaledhosny marked this conversation as resolved.
Show resolved Hide resolved
"setuptools_scm >= 2.1",
"cython >= 0.28.1",
]
build-backend = "setuptools.build_meta"

[project]
name = "uharfbuzz"
version = "0.0.1"

[tool.cibuildwheel]
# only build for 64-bit
Expand Down