[Distutils] combined c/c++ extension

Václav Šmilauer eu at doxos.eu
Sun Dec 30 11:40:53 CET 2012


Hi everybody,

I am compiling an extension consisting of a number of files; some of 
them are c++11, some are plain C. The compiler (gcc) detects language by 
extension, not whether the g++/gcc binary is called. I am passing 
"-std=c++11" to the compiler because of c++ files. *.c files are 
correctly treated as plain C by the compiler and it says:

    cc1.exe: warning: command-line option '-std=c++11' is valid for 
C++/ObjC++ but not for C [enabled by default]

I don't mind seeing that warning, but I would be concerned should it 
become an error at some point in the future.

As far as I see, the current design supposes the whole extension is a 
single language, and single set of compiler flags. Is there a way around it?

Cheers, Vaclav


More information about the Distutils-SIG mailing list