3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/numpy-distutils-C++.patch
Dmitry Kalinkin 095095c479
python: add C++ compiler support for distutils
This should help with builds against clang
2016-10-17 11:23:13 -04:00

24 lines
1.2 KiB
Diff

diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py
index a92ccd3..9630e91 100644
--- a/numpy/distutils/unixccompiler.py
+++ b/numpy/distutils/unixccompiler.py
@@ -43,10 +43,15 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts
if opt not in llink_s:
self.linker_so = llink_s.split() + opt.split()
- display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src)
try:
- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
- extra_postargs, display = display)
+ if self.detect_language(src) == 'c++':
+ display = '%s: %s' % (os.path.basename(self.compiler_so_cxx[0]), src)
+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
+ extra_postargs, display = display)
+ else:
+ display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src)
+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
+ extra_postargs, display = display)
except DistutilsExecError:
msg = str(get_exception())
raise CompileError(msg)