aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python
diff options
context:
space:
mode:
authorAlex Williams <alex.williams@ni.com>2018-04-17 10:36:59 -0700
committerMartin Braun <martin.braun@ettus.com>2018-04-18 15:34:51 -0700
commit7dcd16f5a6980cb1183bf1a10812c952d92c4ddb (patch)
treed1eaa9bdca563fe1f17886d771e16ff65ed153c7 /mpm/python
parente733e590c4b5aa3053af0681bef199d27e4b2d7a (diff)
downloaduhd-7dcd16f5a6980cb1183bf1a10812c952d92c4ddb.tar.gz
uhd-7dcd16f5a6980cb1183bf1a10812c952d92c4ddb.tar.bz2
uhd-7dcd16f5a6980cb1183bf1a10812c952d92c4ddb.zip
mpm: Use configurable components for build system
For a minimal build, default to off for components unless the MPM_DEVICE or the user requests it specifically.
Diffstat (limited to 'mpm/python')
-rw-r--r--mpm/python/CMakeLists.txt1
-rw-r--r--mpm/python/pyusrp_periphs.cpp12
2 files changed, 13 insertions, 0 deletions
diff --git a/mpm/python/CMakeLists.txt b/mpm/python/CMakeLists.txt
index c7a5ac698..2fd71b744 100644
--- a/mpm/python/CMakeLists.txt
+++ b/mpm/python/CMakeLists.txt
@@ -28,6 +28,7 @@ SET(PERIPH_MGR_INIT "${CMAKE_CURRENT_BINARY_DIR}/usrp_mpm/periph_manager/__init_
CONFIGURE_FILE(${SETUP_PY_IN} ${SETUP_PY})
CONFIGURE_FILE(${PERIPH_MGR_INIT_IN} ${PERIPH_MGR_INIT})
+CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/usrp_hwd.py" "${CMAKE_CURRENT_BINARY_DIR}/usrp_hwd.py" COPYONLY)
ADD_CUSTOM_COMMAND(OUTPUT ${OUTPUT}
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}" -DBINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}" -P ${CMAKE_CURRENT_SOURCE_DIR}/copy_python_module.cmake
diff --git a/mpm/python/pyusrp_periphs.cpp b/mpm/python/pyusrp_periphs.cpp
index 716209205..feb7c2bad 100644
--- a/mpm/python/pyusrp_periphs.cpp
+++ b/mpm/python/pyusrp_periphs.cpp
@@ -6,6 +6,7 @@
// 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 */ \
@@ -45,8 +46,15 @@ private:
#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;
@@ -58,7 +66,11 @@ 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
}