1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use super::{IOSContext, IOSError};
use crate::core::{CargoRustc, Manager, Task};
pub struct BuildRuntimeLibraryV2 {
pub cfg: &'static str,
pub target: &'static str,
pub profile: &'static str,
pub flags: &'static [&'static str],
}
impl Task for BuildRuntimeLibraryV2 {
type Context = IOSContext;
type Error = IOSError;
fn verb(&self) -> &str {
"Building"
}
fn message(&self) -> &str {
"runtime library"
}
fn detail(&self) -> &str {
"for iOS"
}
fn run(&self, mut context: IOSContext, _manager: &mut Manager) -> Result<IOSContext, IOSError> {
eprintln!("");
let path = CargoRustc::new(&context.config.manifest_dir.join("Cargo.toml"))
.crate_type("staticlib")
.cfg(self.cfg)
.profile(self.profile)
.release(self.profile == "release")
.target(self.target)
.flags(self.flags)
.build()?;
context.products.insert(self.target.to_owned(), path);
Ok(context)
}
}