optee_utee_build/
lib.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18mod builder;
19mod code_generator;
20mod error;
21mod linker;
22mod ta_config;
23
24pub use builder::*;
25pub use code_generator::*;
26pub use error::Error;
27pub use linker::*;
28pub use ta_config::*;
29pub use uuid::Uuid;
30
31/// a build method, use it for TA compilation
32/// Usage:
33/// ```no_run
34/// use optee_utee_build::{TaConfig, RustEdition};
35/// # use optee_utee_build::Error;
36/// # fn main() -> Result<(), Error> {
37/// const UUID: &str = "d93c2970-b1a6-4b86-90ac-b42830e78d9b";
38/// let ta_config = TaConfig::new_default(UUID, "0.1.0", "example")?;
39/// optee_utee_build::build(RustEdition::Before2024, ta_config)?;
40/// # Ok(())
41/// # }
42/// ```
43///
44/// You may check the Builder struct if you need some customizations.
45pub fn build(edition: RustEdition, config: TaConfig) -> Result<(), Error> {
46    Builder::new(edition, config).build()
47}