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

cffi: Support using --system-zstd #249

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Jan 24, 2025

  1. Refactor make_cffi.py to avoid performing the compilation in global scope, and allow passing parameters
  2. Support --system-zstd with the CFFI backend. This uses the C preprocessor to find the system headers for, well, further preprocessing.

With these changes, I can successfully build the CFFI extension using system zstd library, and have it pass tests. I've also confirmed that it builds fine after removing the zstd directory entirely.

Move the CFFI-related logic from the global scope of `make_cffi.py`
file to a `get_ffi()` function.  This makes it possible to import
the file without executing the code immediately, and it will make it
possible to parametrize the invocation using explicit function
parameters.  Along with the change, I've renamed the variables to
lowercase since they are no longer global.
Support using the system zstd library with the CFFI backend.  Use
the GCC / Clang preprocessor output to find the paths to header files
for preprocessing.  Link to the system library, matching the behavior
for the C backend.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant