Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cygwinccompiler: Get the compilers from sysconfig #296

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions distutils/cygwinccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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 @@ -61,8 +62,12 @@ 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')

# Override 'CC' and 'CXX' environment variables for
# building using MINGW compiler for MSVC python.
self.cc = os.environ.get('CC', self.cc or 'gcc')
self.cxx = os.environ.get('CXX', self.cxx or 'g++')

self.linker_dll = self.cc
self.linker_dll_cxx = self.cxx
Expand Down
Loading