diff --git a/Cargo.toml b/Cargo.toml index 0f69ab233..3de4d870f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -270,15 +270,110 @@ headers = ["headers-shared", "headers-um", "headers-vc", "headers-winrt"] "winrt-hstring" = ["um-winnt"] "winrt-inspectable" = ["shared-guiddef", "shared-minwindef", "um-unknwnbase", "um-winnt", "winrt-hstring"] libraries = [ + "avrt", + "advapi32", + "bcrypt", + "comctl32", + "comdlg32", + "credui", + "crypt32", + "d2d1", + "d3d11", + "d3d12", + "d3d9", + "d3dcompiler", + "dbghelp", + "dsound", + "dwmapi", + "dwrite", + "dxgi", + "dxguid", + "gdi32", + "hid", + "httpapi", "kernel32", + "ktmw32", + "mpr", "ncrypt", + "netapi32", + "ntdll", + "odbc32", "ole32", + "oleaut32", + "opengl32", + "pdh", + "psapi", + "runtimeobject", + "sapi", + "secur32", "setupapi", + "shcore", + "shell32", + "user32", + "userenv", + "usp10", + "uuid", + "version", + "vssapi", + "winhttp", "wininet", + "winmm", + "winscard", + "winspool", + "winusb", + "ws2_32", + "xinput", ] "avrt" = [] +"advapi32" = [] +"bcrypt" = [] +"comctl32" = [] +"comdlg32" = [] +"credui" = [] +"crypt32" = [] +"d2d1" = [] +"d3d11" = [] +"d3d12" = [] +"d3d9" = [] +"d3dcompiler" = [] +"dbghelp" = [] +"dsound" = [] +"dwmapi" = [] +"dwrite" = [] +"dxgi" = [] +"dxguid" = [] +"gdi32" = [] +"hid" = [] +"httpapi" = [] "kernel32" = [] -"ole32" = [] +"ktmw32" = [] +"mpr" = [] "ncrypt" = [] +"netapi32" = [] +"ntdll" = [] +"odbc32" = [] +"ole32" = [] +"oleaut32" = [] +"opengl32" = [] +"pdh" = [] +"psapi" = [] +"runtimeobject" = [] +"sapi" = [] +"secur32" = [] "setupapi" = [] +"shcore" = [] +"shell32" = [] +"user32" = [] +"userenv" = [] +"usp10" = [] +"uuid" = [] +"version" = [] +"vssapi" = [] +"winhttp" = [] "wininet" = [] +"winmm" = [] +"winscard" = [] +"winspool" = [] +"winusb" = [] +"ws2_32" = [] +"xinput" = [] diff --git a/build.rs b/build.rs index 4798b22a7..62291dc62 100644 --- a/build.rs +++ b/build.rs @@ -5,22 +5,72 @@ // All files in the project carrying such notice may not be copied, modified, or distributed // except according to those terms. use std::env::var; + const LIBS: &'static [&'static str] = &[ "avrt", + "advapi32", + "bcrypt", + "comctl32", + "comdlg32", + "credui", + "crypt32", + "d2d1", + "d3d11", + "d3d12", + "d3d9", + "d3dcompiler", + "dbghelp", + "dsound", + "dwmapi", + "dwrite", + "dxgi", + "dxguid", + "gdi32", + "hid", + "httpapi", "kernel32", + "ktmw32", + "mpr", "ncrypt", + "netapi32", + "ntdll", + "odbc32", "ole32", + "oleaut32", + "opengl32", + "pdh", + "psapi", + "runtimeobject", + "sapi", + "secur32", "setupapi", + "shcore", + "shell32", + "user32", + "userenv", + "usp10", + "uuid", + "version", + "vssapi", + "winhttp", "wininet", + "winmm", + "winscard", + "winspool", + "winusb", + "ws2_32", + "xinput", ]; + fn main() { let target = var("TARGET").unwrap(); let target: Vec<_> = target.split('-').collect(); if target.get(2) == Some(&"windows") { - link_stuff(); + link_libs(); } } -fn link_stuff() { + +fn link_libs() { for lib in LIBS { if let Ok(_) = var(&format!("CARGO_FEATURE_{}", lib)) { println!("cargo:rustc-link-lib=dylib={}", lib);