diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2019-03-02 17:51:55 +0100 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2019-03-02 17:51:55 +0100 |
commit | d7524c9d9ec6ac8b3db19177b2976187b3b6b3dd (patch) | |
tree | 885d2b4b39e5deac9a856e74fa7e7738187c7b91 /giscanner/ccompiler.py | |
parent | 5b571261470e47f89c1f4728ba8fd376cc4ac9c6 (diff) | |
download | gobject-introspection-d7524c9d9ec6ac8b3db19177b2976187b3b6b3dd.tar.gz |
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.
Diffstat (limited to 'giscanner/ccompiler.py')
-rw-r--r-- | giscanner/ccompiler.py | 7 |
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') |