Mark
Mark

Reputation: 6494

python distutils: how to change default compiler flags for one Extension only

I have setup.py defining two Extensions and I'd like to change default CFLAGS for one extension, but not for the other. I checked the official documentation https://docs.python.org/3/distutils/apiref.html#distutils.core.Extension but it does not explain what I need. It does explain how to add extra compiler/linker flags thoiugh.

What is the right way to do this?

Upvotes: 1

Views: 926

Answers (1)

sophros
sophros

Reputation: 16738

I would follow the recipe from Python Extension Patterns and reset the CFLAGS before compiling the Extensions and then restore them while setting all of the compiler flags in each fo the Extensions separately from scratch.

Upvotes: 2

Related Questions