From: Daniel Elstner Date: Sat, 15 Aug 2015 17:43:29 +0000 (+0200) Subject: setup.py: Do VPATH search for swig/enums.i X-Git-Tag: libsigrok-0.4.0~432 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5a3e34285da1544941fd314079f05a1715fc3de3;p=libsigrok.git setup.py: Do VPATH search for swig/enums.i Also, in swig/classes.i include swig/enums.i rather than plain enums.i, to guard against future name clashes. --- diff --git a/Makefile.am b/Makefile.am index 3cbc570a..665622e3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -611,7 +611,7 @@ $(JCXX): $(JSWG) $(JDOC) bindings/swig/classes.i bindings/swig/enums.i \ $(library_include_HEADERS) $(nodist_library_include_HEADERS) $(AM_V_at)make java-clean $(AM_V_GEN)swig -c++ -java -package org.sigrok.core.classes \ - $(local_includes) -I$(JCLS) -I. -I$(srcdir) -outdir $(JCLS) -o $@ $< + -Ibindings -I$(JCLS) $(local_includes) -I$(srcdir) -outdir $(JCLS) -o $@ $< $(JJAR): $(JCXX) $(AM_V_GEN)$(JAVAC) -sourcepath $(JDIR) -d $(JDIR) $(JSRC) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index b22a6e9b..35b113ab 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -35,7 +35,7 @@ sr_includes, sr_lib_dirs, sr_libs, (sr_version,) = [ includes = ['../../include', '../cxx/include'] includes += [os.path.join(srcdir, path) for path in includes] -includes += ['../..', '../../include/libsigrok', '../cxx/include/libsigrokcxx'] +includes += ['../..'] includes += [i[2:] for i in sr_includes] includes += [np.get_include(), ] libdirs = ['../../.libs', '../cxx/.libs'] + [l[2:] for l in sr_lib_dirs] @@ -77,7 +77,8 @@ setup( ext_modules = [ Extension('sigrok.core._classes', sources = [vpath('sigrok/core/classes.i')], - swig_opts = ['-c++', '-threads', '-Isigrok/core'] + + swig_opts = ['-c++', '-threads', '-Isigrok/core', + '-I..', '-I%s' % os.path.join(srcdir, '..')] + ['-I%s' % i for i in includes], extra_compile_args = ['-std=c++11', '-Wno-uninitialized'], include_dirs = includes, diff --git a/bindings/swig/classes.i b/bindings/swig/classes.i index 6323fab1..b6ddbbca 100644 --- a/bindings/swig/classes.i +++ b/bindings/swig/classes.i @@ -273,7 +273,7 @@ typedef std::map %include -%include "enums.i" +%include "swig/enums.i" namespace sigrok { %include