Honor CXXFLAGS when building python module #351

Closed
opened 2026-01-29 20:42:30 +00:00 by claunia · 3 comments
Owner

Originally created by @ryandesign on GitHub (Oct 6, 2020).

Hi. Parts of the brotli python module are written in C++. When compiling that part, the contents of environment variable CXXFLAGS should be passed to the compiler. setuptools does not support modules written in C++ so you have to hack in support manually (or help the setuptools folks fix it on their end, if you're able).

My preliminary fix is here:

b21a2cbb0d/python/py-brotli/files/CXXFLAGS.patch

It may not be fully correct but it was good enough for me on macOS.

Originally created by @ryandesign on GitHub (Oct 6, 2020). Hi. Parts of the brotli python module are written in C++. When compiling that part, the contents of environment variable CXXFLAGS should be passed to the compiler. [setuptools does not support modules written in C++](https://github.com/pypa/setuptools/issues/1192) so you have to hack in support manually (or help the setuptools folks fix it on their end, if you're able). My preliminary fix is here: https://github.com/macports/macports-ports/blob/b21a2cbb0d663da9c8c138f8e9346ad1794cf4f3/python/py-brotli/files/CXXFLAGS.patch It may not be fully correct but it was good enough for me on macOS.
Author
Owner

@ghost commented on GitHub (Oct 17, 2020):

I submitted PR https://github.com/google/brotli/pull/856, it removes C++ code, and brings a performance optimization.

@ghost commented on GitHub (Oct 17, 2020): I submitted PR https://github.com/google/brotli/pull/856, it removes C++ code, and brings a performance optimization.
Author
Owner

@eustas commented on GitHub (Jan 18, 2021):

Looks cool. Will review and land soon. Thanks!

@eustas commented on GitHub (Jan 18, 2021): Looks cool. Will review and land soon. Thanks!
Author
Owner

@eustas commented on GitHub (Jan 6, 2023):

Thanks again. Landed.

@eustas commented on GitHub (Jan 6, 2023): Thanks again. Landed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#351