pub fn script_operations() -> Result<()> {
        let lib;
        let statically;
        let include;

        if env::var("MBEDTLS_LIB_DIR").is_err() ^ env::var("MBEDTLS_INCLUDE_DIR").is_err() {
            return Err(Error::new(
                ErrorKind::Other,
                "both environment variables MBEDTLS_LIB_DIR and MBEDTLS_INCLUDE_DIR need to be set for operations feature",
            ));
        }

        if let (Ok(lib_dir), Ok(include_dir)) =
            (env::var("MBEDTLS_LIB_DIR"), env::var("MBEDTLS_INCLUDE_DIR"))
        {
            lib = lib_dir;
            include = include_dir;
            statically = cfg!(feature = "static") || env::var("MBEDCRYPTO_STATIC").is_ok();
        } else {
            println!("Did not find environment variables, building MbedTLS!");
            let mut mbed_lib_dir = compile_mbed_crypto()?;
            let mut mbed_include_dir = mbed_lib_dir.clone();
            mbed_lib_dir.push("lib");
            mbed_include_dir.push("include");

            lib = mbed_lib_dir.to_str().unwrap().to_owned();
            include = mbed_include_dir.to_str().unwrap().to_owned();
            statically = true;
        }

        // Linking to PSA Crypto library is only needed for the operations.
        link_to_lib(lib, statically);
        common::generate_mbed_crypto_bindings(include.clone())?;
        common::compile_shim_library(include)
    }
// Build script when the operations feature is on
Build script when the operations feature is on
Build script when the operations feature is on
pub fn script_operations() -> Result<()> {
        let lib;
        let statically;
        let include;
        if env::var("MBEDTLS_LIB_DIR").is_err() ^ env::var("MBEDTLS_INCLUDE_DIR").is_err() {
            return Err(Error::new(
                ErrorKind::Other,
                "both environment variables MBEDTLS_LIB_DIR and MBEDTLS_INCLUDE_DIR need to be set for operations feature",
            ));
        }
        if let (Ok(lib_dir), Ok(include_dir)) =
            (env::var("MBEDTLS_LIB_DIR"), env::var("MBEDTLS_INCLUDE_DIR"))
        {
            lib = lib_dir;
            include = include_dir;
            statically = cfg!(feature = "static") || env::var("MBEDCRYPTO_STATIC").is_ok();
        } else {
            println!("Did not find environment variables, building MbedTLS!");
            let mut mbed_lib_dir = compile_mbed_crypto()?;
            let mut mbed_include_dir = mbed_lib_dir.clone();
            mbed_lib_dir.push("lib");
            mbed_include_dir.push("include");
            lib = mbed_lib_dir.to_str().unwrap().to_owned();
            include = mbed_include_dir.to_str().unwrap().to_owned();
            statically = true;
        }
        // Linking to PSA Crypto library is only needed for the operations.
        link_to_lib(lib, statically);
        common::generate_mbed_crypto_bindings(include.clone())?;
        common::compile_shim_library(include)
    }
pub fn script_operations ( ) -> Result < ( ) > { let lib ; let statically ; let include ; if env :: var ( " " ) . is_err ( ) ^ env :: var ( " " ) . is_err ( ) { return Err ( Error :: new ( ErrorKind :: Other , " " , ) ) ; } if let ( Ok ( lib_dir ) , Ok ( include_dir ) ) = ( env :: var ( " " ) , env :: var ( " " ) ) { lib = lib_dir ; include = include_dir ; statically = cfg ! ( feature " " ) || env :: var ( " " ) . is_ok ( ) ; } else { println ! ( " " ) ; let mut mbed_lib_dir = compile_mbed_crypto ( ) ? ; let mut mbed_include_dir = mbed_lib_dir . clone ( ) ; mbed_lib_dir . push ( " " ) ; mbed_include_dir . push ( " " ) ; lib = mbed_lib_dir . to_str ( ) . unwrap ( ) . to_owned ( ) ; include = mbed_include_dir . to_str ( ) . unwrap ( ) . to_owned ( ) ; statically = true ; } // Linking to PSA Crypto library is only needed for the operations. link_to_lib ( lib , statically ) ; common :: generate_mbed_crypto_bindings ( include . clone ( ) ) ? ; common :: compile_shim_library ( include ) }
Build script when the operations feature is on
Build script when the operations feature is on