crosvm/net_util/build.rs
Dennis Kempin 1dab58a2cf Update all copyright headers to match new style
This search/replace updates all copyright notices to drop the
"All rights reserved", Use "ChromiumOS" instead of "Chromium OS"
and drops the trailing dots.

This fulfills the request from legal and unifies our notices.

./tools/health-check has been updated to only accept this style.

BUG=b:246579983
TEST=./tools/health-check

Change-Id: I87a80701dc651f1baf4820e5cc42469d7c5f5bf7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3894243
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-09-13 18:41:29 +00:00

43 lines
1.5 KiB
Rust

// Copyright 2020 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#[cfg(all(feature = "slirp", windows))]
mod win_slirp {
use std::env;
pub(super) fn main() {
// This must be an absolute path or linking issues will result when a consuming crate
// tries to link since $PWD will be different.
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
#[cfg(debug_assertions)]
let build_type = "debug";
#[cfg(not(debug_assertions))]
let build_type = "release";
println!(
r#"cargo:rustc-link-search={}\..\..\..\third_party\libslirp\{}"#,
manifest_dir, build_type
);
println!(
r#"cargo:rustc-env=PATH={};{}\..\..\..\third_party\libslirp\{};"#,
env::var("PATH").unwrap(),
manifest_dir,
build_type,
);
}
}
fn main() {
// We (the Windows crosvm maintainers) submitted upstream patches to libslirp-sys so it doesn't
// try to link directly on Windows. This is because linking on Windows tends to be specific
// to the build system that invokes Cargo (e.g. the crosvm jCI scripts that also produce the
// required libslirp DLL & lib). The integration here (win_slirp::main) is specific to crosvm's
// build process.
#[cfg(all(feature = "slirp", windows))]
win_slirp::main();
// For unix, libslirp-sys's build script will make the appropriate linking calls to pkg_config.
}