Commit d7524c9d authored by Christoph Reiter's avatar Christoph Reiter 🐍

ccompiler: restore customize_compiler() setup for macOS. See #268

The original customize_compiler() calls into  _osx_support.customize_compiler()
the first time it is used and I didn't copy it in !118 because it is private API.

Issue #268 points out that the macOS build is broken now so I guess that was important
in some way. Make sure the setup code is run by calling the original customize_compiler()
with a dummy compiler instance.
parent 5b571261
Pipeline #64516 passed with stages
in 9 minutes and 29 seconds
......@@ -30,6 +30,7 @@ from distutils.msvccompiler import MSVCCompiler
from distutils.unixccompiler import UnixCCompiler
from distutils.cygwinccompiler import Mingw32CCompiler
from distutils.sysconfig import get_config_vars
from distutils.sysconfig import customize_compiler as orig_customize_compiler
from . import utils
......@@ -40,6 +41,12 @@ def customize_compiler(compiler):
defaults if alternatives through env vars are given.
"""
# The original customize_compiler() in distutils calls into macOS setup
# code the first time it is called. This makes sure we run that setup
# code as well.
dummy = distutils.ccompiler.new_compiler()
orig_customize_compiler(dummy)
if compiler.compiler_type == "unix":
(cc, cxx, ldshared, shlib_suffix, ar, ar_flags) = \
get_config_vars('CC', 'CXX', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment