mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00

* Prepare to switch Rust import style * Run nightly format Closes #2320 * Clean up a few imports * Enable comment wrapping * Wrap comments
22 lines
729 B
Rust
22 lines
729 B
Rust
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
use std::env;
|
|
|
|
use ninja_gen::archives::Platform;
|
|
|
|
/// Usually None to use the host architecture; can be overriden by setting
|
|
/// MAC_X86 to build for x86_64 on Apple Silicon
|
|
pub fn overriden_rust_target_triple() -> Option<&'static str> {
|
|
overriden_python_target_platform().map(|p| p.as_rust_triple())
|
|
}
|
|
|
|
/// Usually None to use the host architecture; can be overriden by setting
|
|
/// MAC_X86 to build for x86_64 on Apple Silicon
|
|
pub fn overriden_python_target_platform() -> Option<Platform> {
|
|
if env::var("MAC_X86").is_ok() {
|
|
Some(Platform::MacX64)
|
|
} else {
|
|
None
|
|
}
|
|
}
|