Skip to content

Commit

Permalink
BUG: customize compiler when needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
cournape committed May 17, 2012
1 parent 4f70533 commit 0fe4cc3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion yaku/tools/pyext.py
Expand Up @@ -412,18 +412,20 @@ def detect_type(vflag):


def get_distutils_cc_exec(ctx, compiler_type="default"): def get_distutils_cc_exec(ctx, compiler_type="default"):
from distutils import ccompiler from distutils import ccompiler
from distutils.sysconfig import customize_compiler


_OUTPUT.write("Detecting distutils CC exec ... ") _OUTPUT.write("Detecting distutils CC exec ... ")
if compiler_type == "default": if compiler_type == "default":
compiler_type = \ compiler_type = \
distutils.ccompiler.get_default_compiler() distutils.ccompiler.get_default_compiler()


compiler = ccompiler.new_compiler(compiler=compiler_type) compiler = ccompiler.new_compiler(compiler=compiler_type)
customize_compiler(compiler)
if compiler_type == "msvc": if compiler_type == "msvc":
compiler.initialize() compiler.initialize()
cc = [compiler.cc] cc = [compiler.cc]
else: else:
cc = compiler.compiler_so cc = compiler.compiler_so[:1]
_OUTPUT.write("%s\n" % " ".join(cc)) _OUTPUT.write("%s\n" % " ".join(cc))
return cc return cc


Expand Down

0 comments on commit 0fe4cc3

Please sign in to comment.