jeudi 21 juillet 2016

setup.py for Python 2.7 with mixed language source?

How in setup.py does one detect the current compiler and/or source file for a given step of the build in order to set the proper command line arguments?

This came up while trying to build a package which consists of a mix of Python, C++, and C code. In order to get a clean compile of many of the *.cpp source files in this environment "-std=c++0x" must be added to "extra_compiler_args". However, compiling a C module with this command line flag throws a warning since it isn't valid for gcc. In this case that isn't fatal, but it raises the general question.

Aucun commentaire:

Enregistrer un commentaire