MCPcopy Create free account
hub / github.com/numpy/numpy / CCompiler_cxx_compiler

Function CCompiler_cxx_compiler

numpy/distutils/ccompiler.py:678–712  ·  view source on GitHub ↗

Return the C++ compiler. Parameters ---------- None Returns ------- cxx : class instance The C++ compiler, as a `CCompiler` instance.

(self)

Source from the content-addressed store, hash-verified

676replace_method(CCompiler, 'get_version', CCompiler_get_version)
677
678def CCompiler_cxx_compiler(self):
679 """
680 Return the C++ compiler.
681
682 Parameters
683 ----------
684 None
685
686 Returns
687 -------
688 cxx : class instance
689 The C++ compiler, as a `CCompiler` instance.
690
691 """
692 if self.compiler_type in ('msvc', 'intelw', 'intelemw'):
693 return self
694
695 cxx = copy(self)
696 cxx.compiler_cxx = cxx.compiler_cxx
697 cxx.compiler_so = [cxx.compiler_cxx[0]] + \
698 sanitize_cxx_flags(cxx.compiler_so[1:])
699 if (sys.platform.startswith(('aix', 'os400')) and
700 'ld_so_aix' in cxx.linker_so[0]):
701 # AIX needs the ld_so_aix script included with Python
702 cxx.linker_so = [cxx.linker_so[0], cxx.compiler_cxx[0]] \
703 + cxx.linker_so[2:]
704 if sys.platform.startswith('os400'):
705 #This is required by i 7.4 and prievous for PRId64 in printf() call.
706 cxx.compiler_so.append('-D__STDC_FORMAT_MACROS')
707 #This a bug of gcc10.3, which failed to handle the TLS init.
708 cxx.compiler_so.append('-fno-extern-tls-init')
709 cxx.linker_so.append('-fno-extern-tls-init')
710 else:
711 cxx.linker_so = [cxx.compiler_cxx[0]] + cxx.linker_so[1:]
712 return cxx
713
714replace_method(CCompiler, 'cxx_compiler', CCompiler_cxx_compiler)
715

Callers

nothing calls this directly

Calls 3

sanitize_cxx_flagsFunction · 0.90
startswithMethod · 0.80
copyFunction · 0.50

Tested by

no test coverage detected