Skip to content

Commit

Permalink
Merge pull request #2795 from d5h/issue_2551
Browse files Browse the repository at this point in the history
Fix distutils build_src with 'c++' in swig_opts and a c++ comment in the...
  • Loading branch information
rgommers committed Dec 8, 2012
2 parents 686bcfd + 761ba5d commit 9c5a922
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions numpy/distutils/command/build_src.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9c5a922

Please sign in to comment.