예제 #1
0
 def initialize(self, plat_name=None):
     MSVCCompiler.initialize(self)
     self.cc = _find_exe("icl.exe")
     self.lib = _find_exe("xilib.exe")
     self.linker = _find_exe("xilink.exe")
     self.compile_options = ['/nologo', '/O3', '/MD', '/W3', '/Qstd=c99']
     self.compile_options_debug = [
         '/nologo', '/Od', '/MDd', '/W3', '/Qstd=c99', '/Z7', '/D_DEBUG'
     ]
예제 #2
0
def find_tools():
    """Find and return the location of the 'lib' and 'dumpbin' tools.
    
    Also returns the environment in which they should be run.
    """
    compiler = MSVCCompiler()
    compiler.initialize()

    paths = compiler._paths.split(os.pathsep)
    lib = compiler.lib
    dumpbin = _find_exe('dumpbin.exe', paths)

    env = copy(os.environ)
    env['path'] = os.pathsep.join(paths)

    return lib, dumpbin, env
예제 #3
0
파일: build.py 프로젝트: mkardel/optimuspy
def compile_with_msvcc():
    msvcc = MSVCCompiler()
    msvcc.initialize()
    msvcc.add_include_dir(cvars['INCLUDEPY'])
    msvcc.add_library_dir(os.path.join(cvars['exec_prefix'], 'libs'))

    args = [msvcc.cc]
    args += ['/nologo', '/Ox', '/W3', '/GL', '/DNDEBUG', '/MD']
    args += ['-I' + inc for inc in msvcc.include_dirs]
    args += ['optimuspy.cpp']
    args += ['/link']
    args += ['/LIBPATH:' + inc for inc in msvcc.library_dirs]
    args += ['User32.lib', 'Shell32.lib']
    args += ['/OUT:optimuspy.exe']

    subprocess.Popen(args).wait()

    for temp in ['optimuspy.obj', 'optimuspy.lib', 'optimuspy.exp']:
        if os.path.isfile(temp):
            os.unlink(temp)