Standard distutils package problems with MSVC / lacking functionality?

Alf P. Steinbach /Usenet alf.p.steinbach+usenet at gmail.com
Mon Jul 12 16:59:44 EDT 2010


I let the setup.py script talk:


<code>
# 03_1__noddy

from distutils.core import setup, Extension
import distutils.ccompiler

compilerName = distutils.ccompiler.get_default_compiler()
options = []
if compilerName == "msvc":
     # * distutils sets warning level 3:
     #   Overriding with warning level 4 generates command line warning D9025...
     #   There's no good away around that, it needs fix/extension of distutils
     #   or the config file(s) that distutil uses (perhaps that's a makefile?).
     options.append( "/W4" )                     # Must be done in this script.
     # * distutils forgets to enable exception handling:
     options.append( "/EHsc" )                   # Could be done via CL env. var.
     # * distutils forgets to enable RTTI:
     options.append( "/GR" )                     # Could be done via CL env. var.
     # * distutils forgets to enable standard 'for' loop and 'wchar_t' type:
     options.append( "/Zc:forScope,wchar_t" )    # Could be done via CL env. var.

module1 = Extension(
     name = "noddy",
     sources = [ "noddy.cpp" ],
     extra_compile_args = options
     )

setup(
     name            = "noddy",
     version         = '1.0',
     description     = 'This is a demo package',
     ext_modules     = [module1]
     )
</code>


Cheers,

- Alf

-- 
blog at <url: http://alfps.wordpress.com>



More information about the Python-list mailing list