Lines Matching refs:self
201 def __init__(self, verbose=0, dry_run=0, force=0):
202 CCompiler.__init__ (self, verbose, dry_run, force)
204 self.plat_name = None
205 self.initialized = False
207 def initialize(self, plat_name=None):
209 assert not self.initialized, "don't init multiple times"
225 self._paths = vc_env.get('path', '')
226 paths = self._paths.split(os.pathsep)
227 self.cc = _find_exe("cl.exe", paths)
228 self.linker = _find_exe("link.exe", paths)
229 self.lib = _find_exe("lib.exe", paths)
230 self.rc = _find_exe("rc.exe", paths) # resource compiler
231 self.mc = _find_exe("mc.exe", paths) # message compiler
232 self.mt = _find_exe("mt.exe", paths) # message compiler
236 self.add_include_dir(dir.rstrip(os.sep))
240 self.add_library_dir(dir.rstrip(os.sep))
242 self.preprocess_options = None
246 self.compile_options = [
250 self.compile_options_debug = [
262 self.ldflags_exe = [*ldflags, '/MANIFEST:EMBED,ID=1']
263 self.ldflags_exe_debug = [*ldflags_debug, '/MANIFEST:EMBED,ID=1']
264 self.ldflags_shared = [*ldflags, '/DLL', '/MANIFEST:EMBED,ID=2', '/MANIFESTUAC:NO']
265 self.ldflags_shared_debug = [*ldflags_debug, '/DLL', '/MANIFEST:EMBED,ID=2', '/MANIFESTUAC:NO']
266 self.ldflags_static = [*ldflags]
267 self.ldflags_static_debug = [*ldflags_debug]
269 self._ldflags = {
270 (CCompiler.EXECUTABLE, None): self.ldflags_exe,
271 (CCompiler.EXECUTABLE, False): self.ldflags_exe,
272 (CCompiler.EXECUTABLE, True): self.ldflags_exe_debug,
273 (CCompiler.SHARED_OBJECT, None): self.ldflags_shared,
274 (CCompiler.SHARED_OBJECT, False): self.ldflags_shared,
275 (CCompiler.SHARED_OBJECT, True): self.ldflags_shared_debug,
276 (CCompiler.SHARED_LIBRARY, None): self.ldflags_static,
277 (CCompiler.SHARED_LIBRARY, False): self.ldflags_static,
278 (CCompiler.SHARED_LIBRARY, True): self.ldflags_static_debug,
281 self.initialized = True
285 def object_filenames(self,
290 **{ext: self.obj_extension for ext in self.src_extensions},
291 **{ext: self.res_extension for ext in self._rc_extensions + self._mc_extensions},
318 def compile(self, sources,
322 if not self.initialized:
323 self.initialize()
324 compile_info = self._setup_compile(output_dir, macros, include_dirs,
331 compile_opts.extend(self.compile_options_debug)
333 compile_opts.extend(self.compile_options)
349 if ext in self._c_extensions:
351 elif ext in self._cpp_extensions:
354 elif ext in self._rc_extensions:
359 self.spawn([self.rc] + pp_opts + [output_opt, input_opt])
363 elif ext in self._mc_extensions:
379 self.spawn([self.mc, '-h', h_dir, '-r', rc_dir, src])
383 self.spawn([self.rc, "/fo" + obj, rc_file])
393 args = [self.cc] + compile_opts + pp_opts
401 self.spawn(args)
408 def create_static_lib(self,
415 if not self.initialized:
416 self.initialize()
417 objects, output_dir = self._fix_object_args(objects, output_dir)
418 output_filename = self.library_filename(output_libname,
421 if self._need_link(objects, output_filename):
426 log.debug('Executing "%s" %s', self.lib, ' '.join(lib_args))
427 self.spawn([self.lib] + lib_args)
434 def link(self,
449 if not self.initialized:
450 self.initialize()
451 objects, output_dir = self._fix_object_args(objects, output_dir)
452 fixed_args = self._fix_lib_args(libraries, library_dirs,
457 self.warn("I don't know what to do with 'runtime_library_dirs': "
460 lib_opts = gen_lib_options(self,
466 if self._need_link(objects, output_filename):
467 ldflags = self._ldflags[target_desc, debug]
485 self.library_filename(dll_name))
494 self.mkpath(output_dir)
496 log.debug('Executing "%s" %s', self.linker, ' '.join(ld_args))
497 self.spawn([self.linker] + ld_args)
503 def spawn(self, cmd):
506 os.environ['path'] = self._paths
515 def library_dir_option(self, dir):
518 def runtime_library_dir_option(self, dir):
522 def library_option(self, lib):
523 return self.library_filename(lib)
525 def find_library_file(self, dirs, lib, debug=0):
534 libfile = os.path.join(dir, self.library_filename(name))