File: build.rs

package info (click to toggle)
rust-tss-esapi 7.5.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,432 kB
  • sloc: sh: 130; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 538 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Copyright 2021 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0

fn main() {
    if let Ok(tss2_esys_version) = std::env::var("DEP_TSS2_ESYS_VERSION") {
        match tss2_esys_version.chars().next().unwrap() {
            '2' => println!("cargo:rustc-cfg=tpm2_tss_version=\"2\""),
            '3' => println!("cargo:rustc-cfg=tpm2_tss_version=\"3\""),
            '4' => println!("cargo:rustc-cfg=tpm2_tss_version=\"4\""),
            major => panic!("Unsupported TSS version: {}", major),
        }
    }
}