MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Tools/c-analyzer/distutils/cygwinccompiler.py:160–198  ·  view source on GitHub ↗
(self, verbose=0, dry_run=0, force=0)

Source from the content-addressed store, hash-verified

158 compiler_type = 'mingw32'
159
160 def __init__(self, verbose=0, dry_run=0, force=0):
161
162 CygwinCCompiler.__init__ (self, verbose, dry_run, force)
163
164 # ld_version >= "2.13" support -shared so use it instead of
165 # -mdll -static
166 if self.ld_version >= "2.13":
167 shared_option = "-shared"
168 else:
169 shared_option = "-mdll -static"
170
171 # A real mingw32 doesn't need to specify a different entry point,
172 # but cygwin 2.91.57 in no-cygwin-mode needs it.
173 if self.gcc_version <= "2.91.57":
174 entry_point = '--entry _DllMain@12'
175 else:
176 entry_point = ''
177
178 if is_cygwingcc():
179 raise CCompilerError(
180 'Cygwin gcc cannot be used with --compiler=mingw32')
181
182 self.set_executables(compiler='gcc -O -Wall',
183 compiler_so='gcc -mdll -O -Wall',
184 compiler_cxx='g++ -O -Wall',
185 linker_exe='gcc',
186 linker_so='%s %s %s'
187 % (self.linker_dll, shared_option,
188 entry_point))
189 # Maybe we should also append -mthreads, but then the finished
190 # dlls need another dll (mingwm10.dll see Mingw32 docs)
191 # (-mthreads: Support thread-safe exception handling on `Mingw32')
192
193 # no additional libraries needed
194 self.dll_libraries=[]
195
196 # Include the appropriate MSVC runtime library if Python was built
197 # with MSVC 7.0 or later.
198 self.dll_libraries = get_msvcr()
199
200# Because these compilers aren't configured in Python's pyconfig.h file by
201# default, we should at least warn the user if he is using an unmodified

Callers

nothing calls this directly

Calls 5

CCompilerErrorClass · 0.90
is_cygwingccFunction · 0.85
get_msvcrFunction · 0.85
set_executablesMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected