Skip to content

Commit

Permalink
cygwinccompiler: Get the compilers from sysconfig
Browse files Browse the repository at this point in the history
On CLANG64 environment we use should use clang
instead of gcc. This patch gets the compiler from
sysconfig and which would be set when python
was built.

Without this patch, the build fails when it's
trying to check if the compiler is cygwin's one.
`customize_compiler` function handles updates
to the compiler from `CC` and `CXX` environment.
  • Loading branch information
naveen521kk committed Jul 11, 2024
1 parent 1bcd839 commit 4212c4c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions distutils/cygwinccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
DistutilsPlatformError,
)
from .file_util import write_file
from .sysconfig import get_config_vars
from .unixccompiler import UnixCCompiler
from .version import LooseVersion, suppress_known_deprecation

Expand Down Expand Up @@ -95,8 +96,11 @@ def __init__(self, verbose=False, dry_run=False, force=False):
"Compiling may fail because of undefined preprocessor macros."
)

self.cc = os.environ.get('CC', 'gcc')
self.cxx = os.environ.get('CXX', 'g++')
self.cc, self.cxx = get_config_vars('CC', 'CXX')
if self.cc is None:
self.cc = 'gcc'
if self.cxx is None:
self.cxx = 'g++'

self.linker_dll = self.cc
shared_option = "-shared"
Expand Down

0 comments on commit 4212c4c

Please sign in to comment.