From 11caf3fb74b68eda6f823bc5a5c748fb3f982541 Mon Sep 17 00:00:00 2001 From: Be Wilson Date: Thu, 13 Oct 2022 00:43:06 -0500 Subject: [PATCH] switch to static linking on Windows to workaround Cargo not settin rpath https://github.com/KDAB/cxx-qt/issues/224 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ddd59598..ad6df17c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,12 @@ if(VCPKG) set(VCPKG_FEATURE_FLAGS "-compilertracking") set(VCPKG_INSTALL_OPTIONS "--x-abi-tools-use-exact-versions") + # vcpkg defaults to dynamic linking on Windows, which gets messy because + # Cargo does not set rpaths https://github.com/rust-lang/cargo/issues/5077 + if(WIN32) + set(VCPKG_TARGET_TRIPLET "x64-windows-static") + endif() + if(NOT DEFINED ENV{VCPKG_BINARY_SOURCES}) if(WIN32) set(COMMAND_PREIFX "")