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
53
54
55
56
57
58
#![forbid(unsafe_code)]
#![allow(clippy::cognitive_complexity)]
use crate::target::LibraryTarget;
use serde_derive::{Deserialize, Serialize};
pub mod cpp_build_config;
pub mod cpp_lib_builder;
pub mod env_var_names;
pub mod errors;
pub mod file_utils;
pub mod string_utils;
pub mod target;
pub mod utils;
use std::ops::Deref;
pub use toml;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BuildScriptData {
pub cpp_build_config: cpp_build_config::CppBuildConfig,
pub cpp_wrapper_lib_name: String,
pub known_targets: Vec<LibraryTarget>,
}
#[derive(Debug)]
pub struct ReadOnly<T>(T);
impl<T> ReadOnly<T> {
pub fn new(value: T) -> Self {
ReadOnly(value)
}
pub fn into_inner(self) -> T {
self.0
}
}
impl<T> Deref for ReadOnly<T> {
type Target = T;
fn deref(&self) -> &T {
&self.0
}
}
#[cfg(test)]
mod tests;