aboutsummaryrefslogtreecommitdiffstats
path: root/host/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'host/cmake')
-rw-r--r--host/cmake/Modules/UHDBoost.cmake26
-rw-r--r--host/cmake/vcpkg/uhd-x64-windows-static-md.cmake14
-rw-r--r--host/cmake/vcpkg/uhd-x86-windows-static-md.cmake14
3 files changed, 48 insertions, 6 deletions
diff --git a/host/cmake/Modules/UHDBoost.cmake b/host/cmake/Modules/UHDBoost.cmake
index 5ebb4acef..eed94cbfe 100644
--- a/host/cmake/Modules/UHDBoost.cmake
+++ b/host/cmake/Modules/UHDBoost.cmake
@@ -118,12 +118,26 @@ endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
# special Microsoft Visual C handling
if(MSVC)
- set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking")
- if(BOOST_ALL_DYN_LINK)
- add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc
- else(BOOST_ALL_DYN_LINK)
- set(UHD_BOOST_REQUIRED_COMPONENTS) #empty components list for static link
- endif(BOOST_ALL_DYN_LINK)
+ if(VCPKG_TARGET_TRIPLET)
+ message(STATUS " VCPKG Libs")
+ string(FIND ${VCPKG_TARGET_TRIPLET} "static" vcpkg_check_static)
+ string(FIND ${VCPKG_TARGET_TRIPLET} "static-md" vcpkg_check_static_md)
+ if((NOT vcpkg_check_static EQUAL -1) AND vcpkg_check_static_md EQUAL -1)
+ # Statically linked CRT
+ message(STATUS " VCPKG static CRT triplet found. Configuring compiler flags.")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
+ endif((NOT vcpkg_check_static EQUAL -1) AND vcpkg_check_static_md EQUAL -1)
+ else(VCPKG_TARGET_TRIPLET)
+ set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking")
+ if(BOOST_ALL_DYN_LINK)
+ message(STATUS " Dynamic Libs")
+ add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc
+ else(BOOST_ALL_DYN_LINK)
+ message(STATUS " Static Libs")
+ set(UHD_BOOST_REQUIRED_COMPONENTS) #empty components list for static link
+ endif(BOOST_ALL_DYN_LINK)
+ endif(VCPKG_TARGET_TRIPLET)
endif(MSVC)
# Starting in CMake 3.15.0, if policy 'CMP0093' is available and set
diff --git a/host/cmake/vcpkg/uhd-x64-windows-static-md.cmake b/host/cmake/vcpkg/uhd-x64-windows-static-md.cmake
new file mode 100644
index 000000000..ef577045d
--- /dev/null
+++ b/host/cmake/vcpkg/uhd-x64-windows-static-md.cmake
@@ -0,0 +1,14 @@
+set(VCPKG_TARGET_ARCHITECTURE x64)
+set(VCPKG_CRT_LINKAGE dynamic)
+set(VCPKG_LIBRARY_LINKAGE static)
+# uhd dynamic links for boost-test and libusb.
+# The other boost dependencies are static.
+# This maintains historical compatibility
+# with previous binaries.
+if (PORT STREQUAL boost-test)
+ set(VCPKG_LIBRARY_LINKAGE dynamic)
+endif()
+
+if (PORT STREQUAL libusb)
+ set(VCPKG_LIBRARY_LINKAGE dynamic)
+endif()
diff --git a/host/cmake/vcpkg/uhd-x86-windows-static-md.cmake b/host/cmake/vcpkg/uhd-x86-windows-static-md.cmake
new file mode 100644
index 000000000..c8d09179f
--- /dev/null
+++ b/host/cmake/vcpkg/uhd-x86-windows-static-md.cmake
@@ -0,0 +1,14 @@
+set(VCPKG_TARGET_ARCHITECTURE x86)
+set(VCPKG_CRT_LINKAGE dynamic)
+set(VCPKG_LIBRARY_LINKAGE static)
+# uhd dynamic links for boost-test and libusb.
+# The other boost dependencies are static.
+# This maintains historical compatibility
+# with previous binaries.
+if (PORT STREQUAL boost-test)
+ set(VCPKG_LIBRARY_LINKAGE dynamic)
+endif()
+
+if (PORT STREQUAL libusb)
+ set(VCPKG_LIBRARY_LINKAGE dynamic)
+endif()