aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorSteven Koo <steven.koo@ni.com>2021-03-10 12:21:33 -0600
committerAaron Rossetto <aaron.rossetto@ni.com>2021-03-19 15:40:09 -0500
commit9aafc0ace2272746d708dcac6e5daaa50b7da4c7 (patch)
treee26c85e334ca523312719bdae382dda8c18a90c7 /host/include
parentada6a4e46770d22d528b2b6fbc2bdd71e5e3064d (diff)
downloaduhd-9aafc0ace2272746d708dcac6e5daaa50b7da4c7.tar.gz
uhd-9aafc0ace2272746d708dcac6e5daaa50b7da4c7.tar.bz2
uhd-9aafc0ace2272746d708dcac6e5daaa50b7da4c7.zip
uhd: enable vcpkg support on windows
vcpkg can be used for the Windows C++ dependencies for uhd with this commit. To use vcpkg on Windows: 1) Copy the custom triplets in host/cmake/vcpkg/ to the vcpkg/triplets/ folder. 2) Install boost and libusb for the custom triplet "vcpkg install libusb:uhd-x64-windows-static-md boost:uhd-x64-windows-static-md" 3) Call CMake with vcpkg toolchain file flags: -DVCPKG_TARGET_TRIPLET=uhd-x64-windows-static-md -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALL_DIR%/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 16 2019" -A x64 Replace the -G with the installed version of Visual Studio and matching architecture. Then build normally by running vcvarsall.bat and msbuild. Signed-off-by: Steven Koo <steven.koo@ni.com>
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/config.h7
-rw-r--r--host/include/uhd/config.hpp7
2 files changed, 10 insertions, 4 deletions
diff --git a/host/include/uhd/config.h b/host/include/uhd/config.h
index bacda212f..c7184ea4d 100644
--- a/host/include/uhd/config.h
+++ b/host/include/uhd/config.h
@@ -12,8 +12,11 @@
#include <iso646.h>
// Define ssize_t
-#include <stddef.h>
-typedef ptrdiff_t ssize_t;
+#ifndef _SSIZE_T_DEFINED
+#define _SSIZE_T_DEFINED
+# include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#endif /* _SSIZE_T_DEFINED */
#endif /* _MSC_VER */
diff --git a/host/include/uhd/config.hpp b/host/include/uhd/config.hpp
index 99c3731c1..8504e0c18 100644
--- a/host/include/uhd/config.hpp
+++ b/host/include/uhd/config.hpp
@@ -38,8 +38,11 @@
# include <ciso646>
// define ssize_t
-# include <cstddef>
-typedef ptrdiff_t ssize_t;
+#ifndef _SSIZE_T_DEFINED
+#define _SSIZE_T_DEFINED
+# include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#endif /* _SSIZE_T_DEFINED */
#endif // BOOST_MSVC