summaryrefslogtreecommitdiff
path: root/giscanner/ccompiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/ccompiler.py')
-rw-r--r--giscanner/ccompiler.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index aee6a1af..32c92966 100644
--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -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')