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

This commit is contained in:
Federico Terzi 2021-05-21 22:00:02 +02:00
parent ccb3e11d93
commit 04720212e5
3 changed files with 9 additions and 3 deletions

View File

@ -5,6 +5,11 @@ authors = ["Federico Terzi <federico-terzi@users.noreply.github.com>"]
edition = "2018"
build="build.rs"
[features]
# If enabled, avoid linking with the gdiplus library on Windows, which
# might conflict with wxWidgets
avoid-gdi = []
[dependencies]
log = "0.4.14"
serde_json = "1.0.61"

View File

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

View File

@ -41,7 +41,6 @@
#pragma comment(lib, "Shell32.lib")
#include <shellapi.h>
#pragma comment(lib, "Gdi32.lib")
#include <Windows.h>
#include "WinToast/wintoastlib.h"