diff options
Diffstat (limited to 'gr-uhd/swig')
-rw-r--r-- | gr-uhd/swig/Makefile.swig.gen | 10 | ||||
-rw-r--r-- | gr-uhd/swig/uhd_swig.i | 7 |
2 files changed, 16 insertions, 1 deletions
diff --git a/gr-uhd/swig/Makefile.swig.gen b/gr-uhd/swig/Makefile.swig.gen index 3804461a4..f764332f2 100644 --- a/gr-uhd/swig/Makefile.swig.gen +++ b/gr-uhd/swig/Makefile.swig.gen @@ -200,7 +200,15 @@ $(DEPDIR)/uhd_swig-generate-stamp: ## Call SWIG to generate the various output files; special ## post-processing on 'mingw32' host OS for the dependency file. ## - if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(uhd_swig_swig_args) \ + +## If UHD was installed, defined GR_HAVE_UHD for swigging headers +if GR_DEFINE_HAVE_UHD + MY_SWIG_PYTHON_ARGS = $(STD_SWIG_PYTHON_ARGS) -DGR_HAVE_UHD +else + MY_SWIG_PYTHON_ARGS = $(STD_SWIG_PYTHON_ARGS) +endif + + if $(SWIG) $(MY_SWIG_PYTHON_ARGS) $(uhd_swig_swig_args) \ -MD -MF $(DEPDIR)/uhd_swig.Std \ -module uhd_swig -o uhd_swig.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i index 695cf1cd2..4acf2dc83 100644 --- a/gr-uhd/swig/uhd_swig.i +++ b/gr-uhd/swig/uhd_swig.i @@ -20,6 +20,10 @@ * Boston, MA 02110-1301, USA. */ +// Defined during configure; avoids trying to locate +// header files if UHD was not installed. +#ifdef GR_HAVE_UHD + //////////////////////////////////////////////////////////////////////// // Language independent exception handler //////////////////////////////////////////////////////////////////////// @@ -104,3 +108,6 @@ GR_SWIG_BLOCK_MAGIC(uhd,single_usrp_sink) static const size_t ALL_MBOARDS = uhd::usrp::multi_usrp::ALL_MBOARDS; %} static const size_t ALL_MBOARDS; + +#endif + |