diff options
| author | Flaise <[email protected]> | 2019-07-29 15:39:51 -0500 |
|---|---|---|
| committer | Matthew Collins <[email protected]> | 2019-07-30 10:36:45 +0100 |
| commit | 96947258858ccb4fd28c799eae22baee7239333d (patch) | |
| tree | 8ef8a11c0f6a4fa8f975624ca0001036f7b33467 /steamworks-sys | |
| parent | Fix for thread contention causing errors on Mac OS and segfaults on Windows (diff) | |
| download | steamworks-rs-96947258858ccb4fd28c799eae22baee7239333d.tar.xz steamworks-rs-96947258858ccb4fd28c799eae22baee7239333d.zip | |
Fixed build script on Windows
Diffstat (limited to 'steamworks-sys')
| -rwxr-xr-x | steamworks-sys/build.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/steamworks-sys/build.rs b/steamworks-sys/build.rs index ddf1063..031f598 100755 --- a/steamworks-sys/build.rs +++ b/steamworks-sys/build.rs @@ -60,23 +60,22 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { let triple = env::var("TARGET").unwrap(); let mut lib = "steam_api"; let mut packing = 8; - let link_path = if triple.contains("windows") { - if triple.contains("i686") { - sdk_loc.join("redistributable_bin/") - } else { + let mut link_path = sdk_loc.join("redistributable_bin"); + if triple.contains("windows") { + if !triple.contains("i686") { lib = "steam_api64"; - sdk_loc.join("redistributable_bin/win64") + link_path.push("win64"); } } else if triple.contains("linux") { packing = 4; if triple.contains("i686") { - sdk_loc.join("redistributable_bin/linux32") + link_path.push("linux32"); } else { - sdk_loc.join("redistributable_bin/linux64") + link_path.push("linux64"); } } else if triple.contains("darwin") { packing = 4; - sdk_loc.join("redistributable_bin/osx") + link_path.push("osx"); } else { panic!("Unsupported OS"); }; @@ -242,7 +241,10 @@ pub struct {} {{"#, packing, derive, s.struct_)?; fs::write(out_path.join("bindings.rs"), bindings)?; - if triple.contains("darwin") { + if triple.contains("windows") { + let file_name = format!("{}.dll", lib); + fs::copy(link_path.join(&file_name), out_path.join(file_name))?; + } else if triple.contains("darwin") { fs::copy(link_path.join("libsteam_api.dylib"), out_path.join("libsteam_api.dylib"))?; } |