fn emit_late_extras(&self, target: &str) {
        match self {
            &DepState::PkgConfig(ref state) => {
                if let Ok(_) = env::var("TECTONIC_PKGCONFIG_FORCE_SEMI_STATIC") {
                    // pkg-config will prevent "system libraries" from being
                    // linked statically even when PKG_CONFIG_ALL_STATIC=1,
                    // but its definition of a system library isn't always
                    // perfect. For Debian cross builds, we'd like to make
                    // binaries that are dynamically linked with things like
                    // libc and libm but not libharfbuzz, etc. In this mode we
                    // override pkg-config's logic by emitting the metadata
                    // ourselves.
                    for link_path in &state.libs.link_paths {
                        println!("cargo:rustc-link-search=native={}", link_path.display());
                    }

                    for fw_path in &state.libs.framework_paths {
                        println!("cargo:rustc-link-search=framework={}", fw_path.display());
                    }

                    for libbase in &state.libs.libs {
                        let do_static = match libbase.as_ref() {
                            "c" | "m" | "dl" | "pthread" => false,
                            _ => {
                                // Frustratingly, graphite2 seems to have
                                // issues with static builds; e.g. static
                                // graphite2 is not available on Debian. So
                                // let's jump through the hoops of testing
                                // whether the static archive seems findable.
                                let libname = format!("lib{}.a", libbase);
                                state
                                    .libs
                                    .link_paths
                                    .iter()
                                    .any(|d| d.join(&libname).exists())
                            }
                        };

                        let mode = if do_static { "static=" } else { "" };
                        println!("cargo:rustc-link-lib={}{}", mode, libbase);
                    }

                    for fw in &state.libs.frameworks {
                        println!("cargo:rustc-link-lib=framework={}", fw);
                    }
                } else {
                    // Just let pkg-config do its thing.
                    pkg_config::Config::new()
                        .cargo_metadata(true)
                        .probe(PKGCONFIG_LIBS)
                        .unwrap();
                }
            }

            &DepState::VcPkg(_) => {
                if target.contains("-linux-") {
                    // add icudata to the end of the list of libs as vcpkg-rs
                    // does not order individual libraries as a single pass
                    // linker requires.
                    println!("cargo:rustc-link-lib=icudata");
                }
            }
        }
    }
/// This function is called after we've emitted the cargo compilation info
/// for our own libraries. Now we can emit any special information
/// relating to our dependencies, which may depend on the dep-finding
/// backend or the target.
This function is called after we've emitted the cargo compilation info
for our own libraries. Now we can emit any special information
relating to our dependencies, which may depend on the dep-finding
backend or the target.
This function is called after we ' ve emitted the cargo compilation info for our own libraries . Now we can emit any special information relating to our dependencies which may depend on the dep - finding backend or the target .
fn emit_late_extras(&self, target: &str) {
        match self {
            &DepState::PkgConfig(ref state) => {
                if let Ok(_) = env::var("TECTONIC_PKGCONFIG_FORCE_SEMI_STATIC") {
                    // pkg-config will prevent "system libraries" from being
                    // linked statically even when PKG_CONFIG_ALL_STATIC=1,
                    // but its definition of a system library isn't always
                    // perfect. For Debian cross builds, we'd like to make
                    // binaries that are dynamically linked with things like
                    // libc and libm but not libharfbuzz, etc. In this mode we
                    // override pkg-config's logic by emitting the metadata
                    // ourselves.
                    for link_path in &state.libs.link_paths {
                        println!("cargo:rustc-link-search=native={}", link_path.display());
                    }
                    for fw_path in &state.libs.framework_paths {
                        println!("cargo:rustc-link-search=framework={}", fw_path.display());
                    }
                    for libbase in &state.libs.libs {
                        let do_static = match libbase.as_ref() {
                            "c" | "m" | "dl" | "pthread" => false,
                            _ => {
                                // Frustratingly, graphite2 seems to have
                                // issues with static builds; e.g. static
                                // graphite2 is not available on Debian. So
                                // let's jump through the hoops of testing
                                // whether the static archive seems findable.
                                let libname = format!("lib{}.a", libbase);
                                state
                                    .libs
                                    .link_paths
                                    .iter()
                                    .any(|d| d.join(&libname).exists())
                            }
                        };
                        let mode = if do_static { "static=" } else { "" };
                        println!("cargo:rustc-link-lib={}{}", mode, libbase);
                    }
                    for fw in &state.libs.frameworks {
                        println!("cargo:rustc-link-lib=framework={}", fw);
                    }
                } else {
                    // Just let pkg-config do its thing.
                    pkg_config::Config::new()
                        .cargo_metadata(true)
                        .probe(PKGCONFIG_LIBS)
                        .unwrap();
                }
            }
            &DepState::VcPkg(_) => {
                if target.contains("-linux-") {
                    // add icudata to the end of the list of libs as vcpkg-rs
                    // does not order individual libraries as a single pass
                    // linker requires.
                    println!("cargo:rustc-link-lib=icudata");
                }
            }
        }
    }
fn emit_late_extras ( & self , target : & str ) { match self { & DepState :: PkgConfig ( ref state ) => { if let Ok ( _ ) = env :: var ( " " ) { // pkg-config will prevent "system libraries" from being // linked statically even when PKG_CONFIG_ALL_STATIC=1, // but its definition of a system library isn't always // perfect. For Debian cross builds, we'd like to make // binaries that are dynamically linked with things like // libc and libm but not libharfbuzz, etc. In this mode we // override pkg-config's logic by emitting the metadata // ourselves. for link_path in & state . libs . link_paths { println ! ( " " link_path display ( ) ) ; } for fw_path in & state . libs . framework_paths { println ! ( " " fw_path display ( ) ) ; } for libbase in & state . libs . libs { let do_static = match libbase . as_ref ( ) { " " | " " | " " | " " => false , _ => { // Frustratingly, graphite2 seems to have // issues with static builds; e.g. static // graphite2 is not available on Debian. So // let's jump through the hoops of testing // whether the static archive seems findable. let libname = format ! ( " " libbase ) ; state . libs . link_paths . iter ( ) . any ( | d | d . join ( & libname ) . exists ( ) ) } } ; let mode = if do_static { " " } else { " " } ; println ! ( " " mode libbase ) ; } for fw in & state . libs . frameworks { println ! ( " " fw ) ; } } else { // Just let pkg-config do its thing. pkg_config :: Config :: new ( ) . cargo_metadata ( true ) . probe ( PKGCONFIG_LIBS ) . unwrap ( ) ; } } & DepState :: VcPkg ( _ ) => { if target . contains ( " " ) { // add icudata to the end of the list of libs as vcpkg-rs // does not order individual libraries as a single pass // linker requires. println ! ( " " ) ; } } } }
This function is called after we've emitted the cargo compilation info
for our own libraries.
This function is called after we ' ve emitted the cargo compilation info for our own libraries .
&self
target
&str