oodle: Fix linking statically #121
2 changed files with 11 additions and 13 deletions
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
- all: force unix path separators for engine values
|
- all: force unix path separators for engine values
|
||||||
- dtmt: fix extracing files with non-flattened file names
|
- dtmt: fix extracing files with non-flattened file names
|
||||||
|
- oodle: fix static linking
|
||||||
|
|
||||||
== 2023-03-01
|
== 2023-03-01
|
||||||
|
|
||||||
|
|
|
@ -4,24 +4,21 @@ use std::env;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Tell cargo to look for shared libraries in the specified directory
|
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("No CARGO_MANIFEST_DIR");
|
||||||
if let Ok(manifest_dir) = std::env::var("CARGO_MANIFEST_DIR") {
|
println!("cargo:rustc-link-search=native={}", &manifest_dir);
|
||||||
println!("cargo:rustc-link-search={}", manifest_dir);
|
|
||||||
dbg!(&manifest_dir);
|
dbg!(&manifest_dir);
|
||||||
}
|
|
||||||
|
|
||||||
let lib_name = if std::env::var("CARGO_CFG_WINDOWS").is_ok() {
|
if std::env::var("CARGO_CFG_WINDOWS").is_ok() {
|
||||||
if cfg!(debug_assertions) {
|
let lib_name = if cfg!(debug_assertions) {
|
||||||
"oo2core_win64_debug"
|
"oo2core_win64_debug"
|
||||||
} else {
|
} else {
|
||||||
"oo2core_win64"
|
"oo2core_win64"
|
||||||
}
|
|
||||||
} else {
|
|
||||||
"oo2corelinux64"
|
|
||||||
};
|
};
|
||||||
|
println!("cargo:rustc-link-lib=static={}", lib_name);
|
||||||
println!("cargo:rustc-link-lib={}", lib_name);
|
} else {
|
||||||
dbg!(&lib_name);
|
println!("cargo:rustc-link-lib=static=oo2corelinux64");
|
||||||
|
println!("cargo:rustc-link-lib=stdc++")
|
||||||
|
}
|
||||||
|
|
||||||
println!("cargo:rerun-if-changed=oodle2.h");
|
println!("cargo:rerun-if-changed=oodle2.h");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue