You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let use_static = env::var("CARGO_FEATURE_STATIC").is_ok();
21
+
20
22
// Consider 'FFMS_INCLUDE_DIR' and 'FFMS_LIB_DIR', if pkg-config should not be used.
21
23
let headers = env::var("FFMS_INCLUDE_DIR").map(|value| {
22
24
// Ensure the include directory is valid
@@ -35,9 +37,10 @@ fn main() {
35
37
36
38
// Using dynamic library in Windows remains a problem. We have to copy the DLL into a path...
37
39
// Problem: If 'FFMS_LIB_DIR' is outside of 'target', it is not considered (https://doc.rust-lang.org/cargo/reference/environment-variables.html).
38
-
#[cfg(windows)]{
40
+
// Only handle DLL copying for dynamic linking on Windows
41
+
#[cfg(windows)]
42
+
if !use_static {
39
43
let cargo_output_dir = env::var("OUT_DIR").expect("Unable to get OUT_DIR");
40
-
// We need to add the file in target/{debug|release as it is included in the PATH: https://doc.rust-lang.org/cargo/reference/environment-variables.html#dynamic-library-paths
41
44
let linkable_dll:PathBuf = [cargo_output_dir.as_ref(),"..","..","..","ffms2.dll"].iter().collect();
42
45
43
46
// Copy the file if it does not exists
@@ -52,7 +55,11 @@ fn main() {
52
55
}
53
56
54
57
// Add the flags for cargo otherwise explicitely added by pkg-config-rs
0 commit comments