feat(clipboard): add feature to avoid double linking gdiplus

This commit is contained in:
Federico Terzi 2021-05-21 21:59:29 +02:00
parent c996bbb0f5
commit ccb3e11d93
3 changed files with 9 additions and 1 deletions

View File

@ -10,6 +10,10 @@ build="build.rs"
# and wayland support will be enabled
wayland = ["wait-timeout"]
# If enabled, avoid linking with the gdiplus library on Windows, which
# might conflict with wxWidgets
avoid-gdi = []
[dependencies]
log = "0.4.14"
lazycell = "1.3.0"

View File

@ -30,6 +30,11 @@ fn cc_config() {
println!("cargo:rustc-link-lib=static=espansoclipboard");
println!("cargo:rustc-link-lib=dylib=user32");
println!("cargo:rustc-link-lib=dylib=gdi32");
if cfg!(not(feature = "avoid-gdi")) {
println!("cargo:rustc-link-lib=dylib=gdiplus");
}
#[cfg(target_env = "gnu")]
println!("cargo:rustc-link-lib=dylib=stdc++");
}

View File

@ -38,7 +38,6 @@
#include <winuser.h>
#include <strsafe.h>
#pragma comment(lib, "gdiplus.lib")
#include <gdiplus.h>
#include <Windows.h>