pub fn build(&self) -> Library {
        check_dependencies();

        let out_dir = self.out_dir.as_ref().expect("OUT_DIR not set");
        let themis_src_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("themis");
        let themis_build_dir = out_dir.join("build");
        let themis_install_dir = out_dir.join("install");

        // Themis uses in-source build. Cargo requires build scripts to never write anything
        // outside of OUT_DIR so we just have to copy the source code there.

        if !out_dir.exists() {
            fs::create_dir(&out_dir).expect("mkdir themis");
        }
        if themis_build_dir.exists() {
            fs::remove_dir_all(&themis_build_dir).expect("rm -r themis/build");
        }
        if themis_install_dir.exists() {
            fs::remove_dir_all(&themis_install_dir).expect("rm -r themis/install");
        }

        copy_dir::copy_dir(&themis_src_dir, &themis_build_dir).expect("cp -r src build");
        fs::create_dir(&themis_install_dir).expect("mkdir themis/install");

        // Now we can build Themis and install it properly into OUT_DIR.
        let mut themis_build_and_install = make_cmd::make();
        themis_build_and_install
            .current_dir(&themis_build_dir)
            .env("PREFIX", &themis_install_dir)
            .arg("install");

        // Cargo sets DEBUG environment variable to zero in release builds, but Themis build simply
        // checks existence of this variable. We need to unset it to get real release builds,
        if cfg!(debug) {
            themis_build_and_install.env("DEBUG", "1");
        } else {
            themis_build_and_install.env_remove("DEBUG");
        }

        let status = themis_build_and_install
            .status()
            .expect("failed to run Themis build");

        if !status.success() {
            panic!("Themis build failed: {}", status);
        }

        Library {
            prefix: themis_install_dir,
        }
    }
/// Builds Themis, panics on any errors.
Builds Themis, panics on any errors.
Builds Themis panics on any errors .
pub fn build(&self) -> Library {
        check_dependencies();
        let out_dir = self.out_dir.as_ref().expect("OUT_DIR not set");
        let themis_src_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("themis");
        let themis_build_dir = out_dir.join("build");
        let themis_install_dir = out_dir.join("install");
        // Themis uses in-source build. Cargo requires build scripts to never write anything
        // outside of OUT_DIR so we just have to copy the source code there.
        if !out_dir.exists() {
            fs::create_dir(&out_dir).expect("mkdir themis");
        }
        if themis_build_dir.exists() {
            fs::remove_dir_all(&themis_build_dir).expect("rm -r themis/build");
        }
        if themis_install_dir.exists() {
            fs::remove_dir_all(&themis_install_dir).expect("rm -r themis/install");
        }
        copy_dir::copy_dir(&themis_src_dir, &themis_build_dir).expect("cp -r src build");
        fs::create_dir(&themis_install_dir).expect("mkdir themis/install");
        // Now we can build Themis and install it properly into OUT_DIR.
        let mut themis_build_and_install = make_cmd::make();
        themis_build_and_install
            .current_dir(&themis_build_dir)
            .env("PREFIX", &themis_install_dir)
            .arg("install");
        // Cargo sets DEBUG environment variable to zero in release builds, but Themis build simply
        // checks existence of this variable. We need to unset it to get real release builds,
        if cfg!(debug) {
            themis_build_and_install.env("DEBUG", "1");
        } else {
            themis_build_and_install.env_remove("DEBUG");
        }
        let status = themis_build_and_install
            .status()
            .expect("failed to run Themis build");
        if !status.success() {
            panic!("Themis build failed: {}", status);
        }
        Library {
            prefix: themis_install_dir,
        }
    }
pub fn build ( & self ) -> Library { check_dependencies ( ) ; let out_dir = self . out_dir . as_ref ( ) . expect ( " " ) ; let themis_src_dir = Path :: new ( env ! ( " " ) ) . join ( " " ) ; let themis_build_dir = out_dir . join ( " " ) ; let themis_install_dir = out_dir . join ( " " ) ; // Themis uses in-source build. Cargo requires build scripts to never write anything // outside of OUT_DIR so we just have to copy the source code there. if ! out_dir . exists ( ) { fs :: create_dir ( & out_dir ) . expect ( " " ) ; } if themis_build_dir . exists ( ) { fs :: remove_dir_all ( & themis_build_dir ) . expect ( " " ) ; } if themis_install_dir . exists ( ) { fs :: remove_dir_all ( & themis_install_dir ) . expect ( " " ) ; } copy_dir :: copy_dir ( & themis_src_dir , & themis_build_dir ) . expect ( " " ) ; fs :: create_dir ( & themis_install_dir ) . expect ( " " ) ; // Now we can build Themis and install it properly into OUT_DIR. let mut themis_build_and_install = make_cmd :: make ( ) ; themis_build_and_install . current_dir ( & themis_build_dir ) . env ( " " , & themis_install_dir ) . arg ( " " ) ; // Cargo sets DEBUG environment variable to zero in release builds, but Themis build simply // checks existence of this variable. We need to unset it to get real release builds, if cfg ! ( debug ) { themis_build_and_install . env ( " " , " " ) ; } else { themis_build_and_install . env_remove ( " " ) ; } let status = themis_build_and_install . status ( ) . expect ( " " ) ; if ! status . success ( ) { panic ! ( " " status ) ; } Library { prefix : themis_install_dir , } }
Builds Themis, panics on any errors.
Builds Themis panics on any errors .
&self
&self