def update(self, env): """ Update the environment with specific flags """ t = Tool('qt') t(env) if isinstance(platform, Win32): qt_lib = 'qt-mtnc321' else: qt_lib = 'qt-mt' libpath = str(env.subst(env['QT_LIBPATH'])) multithread = exist(qt_lib, libpath) if multithread: env.AppendUnique(CPPDEFINES=['QT_THREAD_SUPPORT']) env.Replace(QT_LIB=qt_lib) if isinstance(platform, Win32): env.AppendUnique(CPPDEFINES=['QT_DLL'])
def customize_pyext(env): from SCons.Tool import Tool from SCons.Tool.FortranCommon import CreateDialectActions, ShFortranEmitter if sys.platform == 'win32' and is_debug(env): env['PYEXTSUFFIX'] = "_d%s" % get_config_var('SO') else: env['PYEXTSUFFIX'] = get_config_var('SO') t = Tool('pyext', toolpath = get_numscons_toolpaths(env)) t(env) #----------------------------------------------- # Extending pyext to handle fortran source code. #----------------------------------------------- # XXX: This is ugly: I don't see any way to do this cleanly. pyext_obj = t._tool_module().createPythonObjectBuilder(env) if env.has_key('F77') and env['F77']: shcompaction = CreateDialectActions('F77')[2] for suffix in env['F77FILESUFFIXES']: pyext_obj.add_action(suffix, shcompaction) pyext_obj.add_emitter(suffix, ShFortranEmitter) # Customizing pyext to handle windows platform (msvc runtime, etc...) # We don't do this in pyext because scons has no infrastructure to know # whether we are using mingw or ms if sys.platform == 'win32': _customize_pyext_win32(env, t) # XXX: Add numpy header path (will be used by NumpyExtension builder). if is_bootstrapping(env): env['NUMPYCPPPATH'] = scons_get_paths(env['include_bootstrap']) else: from numpy.distutils.misc_util import get_numpy_include_dirs env['NUMPYCPPPATH'] = get_numpy_include_dirs()