Since we're running the etg scripts and sip from build.py then we don't need the distutils hacks needed to run them from setup.py. Deactivate the and just use normal distutils stuff on the generated C++ files.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69075 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-09-13 05:47:13 +00:00
parent 4ecd33b8ce
commit 2d4e4b7ca2
4 changed files with 101 additions and 17 deletions

View File

@@ -170,11 +170,11 @@ class Configuration(object):
else:
self.VCDLL = 'vc_dll'
self.includes = ['include', 'src',
opj(self.WXDIR, 'lib', self.VCDLL, 'msw' + self.libFlag()),
opj(self.WXDIR, 'include'),
opj(self.WXDIR, 'contrib', 'include'),
]
self.includes += ['include',
opj(self.WXDIR, 'lib', self.VCDLL, 'msw' + self.libFlag()),
opj(self.WXDIR, 'include'),
opj(self.WXDIR, 'contrib', 'include'),
]
self.defines = [ ('WIN32', None),
('_WINDOWS', None),
@@ -218,7 +218,7 @@ class Configuration(object):
# Posix (wxGTK, wxMac or mingw32) settings
elif os.name == 'posix' or COMPILER == 'mingw32':
self.Verify_WX_CONFIG()
self.includes = ['include', 'src']
self.includes += ['include']
self.defines = [ ('NDEBUG',), # using a 1-tuple makes it do an undef
]
self.libdirs = []
@@ -560,6 +560,24 @@ def loadETG(name):
def etg2sip(etgfile):
cfg = Config()
sipfile = os.path.splitext(os.path.basename(etgfile))[0] + '.sip'
sipfile = posixjoin(cfg.SIPGEN, sipfile)
return sipfile
def _getSbfValue(etg, keyName):
cfg = Config()
sbf = opj(cfg.SIPOUT, etg.NAME + '.sbf')
out = list()
for line in file(sbf):
key, value = line.split('=')
if key.strip() == keyName:
return [opj(cfg.SIPOUT, v) for v in value.strip().split()]
return None
def getEtgSipCppFiles(etg):
return _getSbfValue(etg, 'sources')
def getEtgSipHeaders(etg):
return _getSbfValue(etg, 'headers')

View File

@@ -234,7 +234,23 @@ class MyUnixCCompiler(distutils.unixccompiler.UnixCCompiler):
except DistutilsExecError, msg:
raise CompileError, msg
def _setup_compile(self, outdir, macros, incdirs, sources, depends, extra):
m = distutils.ccompiler.CCompiler._setup_compile
macros, objects, extra, pp_opts, build = \
m(self, outdir, macros, incdirs, sources, depends, extra)
# Remove items from the build collection that don't need to be built
# because their obj file is newer than the source fle and any other
# dependencies.
# TODO
for obj in objects:
src, ext = build[obj]
if not newer_group([src] + depends, obj):
del build[obj]
return macros, objects, extra, pp_opts, build
_orig_parse_makefile = distutils.sysconfig.parse_makefile
def _parse_makefile(filename, g=None):
rv = _orig_parse_makefile(filename, g)
@@ -331,6 +347,7 @@ class etgsip_build_ext(build_ext):
cfg = Config()
return cfg.SIPOUT
def build_extension(self, extension):
"""
Modify the dependency list, adding the sip files generated