Fix x86-64 check
This commit is contained in:
parent
efeb394826
commit
f853b67688
|
@ -49,20 +49,29 @@ pub fn is_x86_64() -> bool {
|
||||||
static ref IS_X86_64: bool = {
|
static ref IS_X86_64: bool = {
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
// Check LuaJIT version
|
#[cfg(target_os = "windows")] {
|
||||||
unsafe {
|
PathBuf::from("srcds_win64.exe").is_file()
|
||||||
let (lib, _) = lua::LuaShared::find_lua_shared();
|
}
|
||||||
if lib.get::<()>(b"luaJIT_version_2_0_4\0").is_ok() {
|
#[cfg(target_os = "linux")] {
|
||||||
false
|
// Check executable name
|
||||||
} else if lib.get::<()>(b"luaJIT_version_2_1_0_beta3\0").is_ok() {
|
match std::env::current_exe().expect("Failed to get executable path").file_name().expect("Failed to get executable file name").to_string_lossy().as_ref() {
|
||||||
true
|
#[cfg(target_os = "windows")]
|
||||||
} else {
|
"srcds.exe" => false,
|
||||||
// Check bin folder
|
|
||||||
#[cfg(target_os = "linux")] {
|
#[cfg(target_os = "linux")]
|
||||||
PathBuf::from("bin/linux64").is_dir()
|
"srcds_linux" => false,
|
||||||
}
|
|
||||||
#[cfg(target_os = "windows")] {
|
#[cfg(target_os = "linux")]
|
||||||
PathBuf::from("bin/win64").is_dir()
|
"srcds" => true,
|
||||||
|
|
||||||
|
_ => {
|
||||||
|
// Check bin folder
|
||||||
|
#[cfg(target_os = "linux")] {
|
||||||
|
PathBuf::from("bin/linux64").is_dir()
|
||||||
|
}
|
||||||
|
#[cfg(target_os = "windows")] {
|
||||||
|
PathBuf::from("bin/win64").is_dir()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue