Message50147
When the '--swig-opts -c++' command line option is
used, the target extension is changed from .c to .cpp
but when the '-c++' option is passed to an Extension
with the swig_opts keyword argument, the target
extension is not changed. This causes the compiler to
treat the C++ source as C and fail.
With the patch distutils uses the Extension's swig_opts
argument in addition to the command line options to
determine if the target extension should be .c or .cpp.
Here are examples of what arguments get used with the
executables in different situations:
Without -c++
swig.exe -python -Iinclude -o
interface/interface_wrap.c interface/interface.i
cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -Iinclude
-IC:\Python24\include -IC:\Python24\PC
/Tcinterface/interface_wrap.c
/Fobuild\temp.win32-2.4\Release\interface/interface_wrap.obj
With -c++ (as command line option)
swig.exe -python -Iinclude -c++ -o
interface/interface_wrap.cpp interface/interface.i
cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -Iinclude
-IC:\Python24\include -IC:\Python24\PC
/Tpinterface/interface_wrap.cpp
/Fobuild\temp.win32-2.4\Release\interface/interface_wrap.obj
With -c++ (in swig_opts in setup.py)
swig.exe -python -Iinclude -c++ -o
interface/interface_wrap.c interface/interface.i
cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -Iinclude
-IC:\Python24\include -IC:\Python24\PC
/Tcinterface/interface_wrap.c
/Fobuild\temp.win32-2.4\Release\interface/interface_wrap.obj
With -c++ (in swig_opts in setup.py with patch applied)
swig.exe -python -Iinclude -c++ -o
interface/interface_wrap.cpp interface/interface.i
cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -Iinclude
-IC:\Python24\include -IC:\Python24\PC
/Tpinterface/interface_wrap.cpp
/Fobuild\temp.win32-2.4\Release\interface/interface_wrap.obj |
|
Date |
User |
Action |
Args |
2007-08-23 15:48:35 | admin | link | issue1479255 messages |
2007-08-23 15:48:35 | admin | create | |
|