aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Collins <[email protected]>2017-09-06 17:35:45 +0100
committerMatthew Collins <[email protected]>2017-09-06 17:35:45 +0100
commita82696497d7a60984be3c196006619de71358e90 (patch)
treec5ec0e257249d65c96e62f37f2138c33fad855b1
parentAdd license files (diff)
downloadsteamworks-rs-a82696497d7a60984be3c196006619de71358e90.tar.xz
steamworks-rs-a82696497d7a60984be3c196006619de71358e90.zip
Handle the fact windows 64 bit uses a different library name than other platforms
-rw-r--r--steamworks-sys/build.rs3
-rw-r--r--steamworks-sys/src/lib.rs1
2 files changed, 3 insertions, 1 deletions
diff --git a/steamworks-sys/build.rs b/steamworks-sys/build.rs
index 3750ffa..29591be 100644
--- a/steamworks-sys/build.rs
+++ b/steamworks-sys/build.rs
@@ -8,10 +8,12 @@ fn main() {
let sdk_loc = Path::new(&sdk_loc);
let triple = env::var("TARGET").unwrap();
+ let mut lib = "steam_api";
let path = if triple.contains("windows") {
if triple.contains("i686") {
sdk_loc.join("redistributable_bin/")
} else {
+ lib = "steam_api64";
sdk_loc.join("redistributable_bin/win64")
}
} else if triple.contains("linux") {
@@ -26,4 +28,5 @@ fn main() {
panic!("Unsupported OS");
};
println!("cargo:rustc-link-search={}", path.display());
+ println!("cargo:rustc-link-lib=dylib={}", lib);
} \ No newline at end of file
diff --git a/steamworks-sys/src/lib.rs b/steamworks-sys/src/lib.rs
index 98d5fd2..c9ab542 100644
--- a/steamworks-sys/src/lib.rs
+++ b/steamworks-sys/src/lib.rs
@@ -37,7 +37,6 @@ pub enum PersonaState {
Max,
}
-#[link(name="steam_api")]
extern "C" {
pub fn SteamAPI_Init() -> u8;
pub fn SteamAPI_Shutdown();