aboutsummaryrefslogtreecommitdiffstats
path: root/host/CMakeLists.txt
diff options
context:
space:
mode:
authorJoerg Hofrichter <joerg.hofrichter@ni.com>2020-06-23 11:55:17 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2020-06-25 13:32:14 -0500
commite08830cbe5609645462190aa0c1a9e234353f38a (patch)
tree27d01500494dd2d469c6096b251b547f0704b78f /host/CMakeLists.txt
parentafee1888dd7c2d9d95e537f505ce7ab36252763a (diff)
downloaduhd-e08830cbe5609645462190aa0c1a9e234353f38a.tar.gz
uhd-e08830cbe5609645462190aa0c1a9e234353f38a.tar.bz2
uhd-e08830cbe5609645462190aa0c1a9e234353f38a.zip
cmake: tests: Added option to use QEMU for running unittests
This is useful when cross-compiling UHD for other architectures like arm or aarch64.
Diffstat (limited to 'host/CMakeLists.txt')
-rw-r--r--host/CMakeLists.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index a990585c6..0cee8582f 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -276,6 +276,35 @@ if(WIN32)
endif(WIN32)
########################################################################
+# Option to use QEMU for running unittests
+#
+# This is useful when cross-compiling UHD for other architectures like arm or
+# aarch64
+#
+# QEMU_EXECUTABLE must be set to the name of the QEMU executable. When using
+# openembedded build environment, this should be set to "qemu-${TUNE_ARCH}"
+# or "${WORKDIR}/recipe-sysroot-native/usr/bin/qemu-${TUNE_ARCH}"
+#
+# QEMU_SYSROOT must be set to the same sysroot of the target architecture that
+# was used when compiling UHD. When using openembedded build environment, this
+# should be set to "${WORKDIR}/recipe-sysroot"
+########################################################################
+option(ENABLE_QEMU_UNITTESTS "Use QEMU for running unittests" OFF)
+mark_as_advanced(ENABLE_QEMU_UNITTESTS)
+if(ENABLE_QEMU_UNITTESTS)
+ message(STATUS "")
+ message(STATUS "Use QEMU for running unittests: ${ENABLE_QEMU_UNITTESTS}")
+ if("${QEMU_EXECUTABLE}" STREQUAL "")
+ message(FATAL_ERROR "The variable QEMU_EXECUTABLE is not set")
+ endif()
+ if("${QEMU_SYSROOT}" STREQUAL "")
+ message(FATAL_ERROR "The variable QEMU_SYSROOT is not set")
+ endif()
+ message(STATUS " QEMU executable: ${QEMU_EXECUTABLE}")
+ message(STATUS " QEMU sysroot: ${QEMU_SYSROOT}")
+endif(ENABLE_QEMU_UNITTESTS)
+
+########################################################################
# Setup Boost
########################################################################
message(STATUS "")