diff options
| author | Brent Stapleton <brent.stapleton@ettus.com> | 2018-04-17 13:48:29 -0700 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2018-04-18 15:34:51 -0700 | 
| commit | 13b45a08c90912e8baa33b618b152cf41293bb9d (patch) | |
| tree | 71d45d03b9f231fea305d493984d05194a5bb8fc | |
| parent | 7dcd16f5a6980cb1183bf1a10812c952d92c4ddb (diff) | |
| download | uhd-13b45a08c90912e8baa33b618b152cf41293bb9d.tar.gz uhd-13b45a08c90912e8baa33b618b152cf41293bb9d.tar.bz2 uhd-13b45a08c90912e8baa33b618b152cf41293bb9d.zip  | |
mpm: add device-specific Boost.Python bindings
Separating Boost.Python bindings into device-specific files. N3XX code
now lives in n3xx/pyusrp_periphs. Only one src file should be added for
pyusrp_periphs.so by CMake.
| -rw-r--r-- | mpm/python/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | mpm/python/pyusrp_periphs/converters.hpp (renamed from mpm/python/converters.hpp) | 0 | ||||
| -rw-r--r-- | mpm/python/pyusrp_periphs/n3xx/pyusrp_periphs.cpp (renamed from mpm/python/pyusrp_periphs.cpp) | 14 | 
3 files changed, 5 insertions, 14 deletions
diff --git a/mpm/python/CMakeLists.txt b/mpm/python/CMakeLists.txt index 2fd71b744..697c597dd 100644 --- a/mpm/python/CMakeLists.txt +++ b/mpm/python/CMakeLists.txt @@ -8,7 +8,10 @@  # This file included, use CMake directory variables  ######################################################################## -ADD_LIBRARY(pyusrp_periphs SHARED pyusrp_periphs.cpp) +if(MPM_DEVICE STREQUAL "n3xx") +    ADD_LIBRARY(pyusrp_periphs SHARED pyusrp_periphs/n3xx/pyusrp_periphs.cpp) +endif(MPM_DEVICE STREQUAL "n3xx") +  TARGET_INCLUDE_DIRECTORIES(pyusrp_periphs PUBLIC      ${PYTHON_INCLUDE_DIRS}      ${CMAKE_SOURCE_DIR}/lib/ diff --git a/mpm/python/converters.hpp b/mpm/python/pyusrp_periphs/converters.hpp index ede9507a9..ede9507a9 100644 --- a/mpm/python/converters.hpp +++ b/mpm/python/pyusrp_periphs/converters.hpp diff --git a/mpm/python/pyusrp_periphs.cpp b/mpm/python/pyusrp_periphs/n3xx/pyusrp_periphs.cpp index feb7c2bad..048ca6a44 100644 --- a/mpm/python/pyusrp_periphs.cpp +++ b/mpm/python/pyusrp_periphs/n3xx/pyusrp_periphs.cpp @@ -6,7 +6,6 @@  // include hackery to only include boost python and define the macro here  #include <boost/python.hpp> -#include <config.h>  #define LIBMPM_PYTHON  #define LIBMPM_BOOST_PREAMBLE(module)  \      /* Register submodule types */      \ @@ -42,19 +41,12 @@ private:  };  //#include "types.hpp" -#include "converters.hpp" +#include "../converters.hpp"  #include <mpm/xbar_iface.hpp>  #include <mpm/types/types_python.hpp>  #include <mpm/spi/spi_python.hpp> - -#ifdef ENABLE_MYKONOS  #include <mpm/ad937x/ad937x_ctrl.hpp> -#endif - -#ifdef ENABLE_MAGNESIUM  #include <mpm/dboards/magnesium_manager.hpp> -#endif -  #include <boost/noncopyable.hpp>  namespace bp = boost::python; @@ -66,11 +58,7 @@ BOOST_PYTHON_MODULE(libpyusrp_periphs)      export_converter();      export_types();      export_spi(); -#ifdef ENABLE_MYKONOS      export_mykonos(); -#endif      export_xbar(); -#ifdef ENABLE_MAGNESIUM      export_magnesium(); -#endif  }  | 
