Permalink
Browse files

Merge pull request #2795 from d5h/issue_2551

Fix distutils build_src with 'c++' in swig_opts and a c++ comment in the...
  • Loading branch information...
2 parents 686bcfd + 761ba5d commit 9c5a9226e7d742e3549d4e53d07d53517096f123 @rgommers rgommers committed Dec 8, 2012
Showing with 2 additions and 5 deletions.
  1. +2 −5 numpy/distutils/command/build_src.py
@@ -673,24 +673,21 @@ def swig_sources(self, sources, extension):
if typ is None:
typ = get_swig_target(source)
is_cpp = typ=='c++'
- if is_cpp:
- target_ext = '.cpp'
else:
typ2 = get_swig_target(source)
if typ2 is None:
log.warn('source %r does not define swig target, assuming %s swig target' \
% (source, typ))
- if is_cpp:
- target_ext = '.cpp'
elif typ!=typ2:
log.warn('expected %r but source %r defines %r swig target' \
% (typ, source, typ2))
if typ2=='c++':
log.warn('resetting swig target to c++ (some targets may have .c extension)')
is_cpp = True
- target_ext = '.cpp'
else:
log.warn('assuming that %r has c++ swig target' % (source))
+ if is_cpp:
+ target_ext = '.cpp'
target_file = os.path.join(target_dir,'%s_wrap%s' \
% (name, target_ext))
else:

0 comments on commit 9c5a922

Please sign in to comment.