xref: /aosp_15_r20/external/crosvm/media/libvda/build.rs (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1 // Copyright 2019 The ChromiumOS Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
main()5 fn main() {
6     // libvda is only avalable on chromeos build.
7     // To enable clippy checks with this feature enabled upstream we will just skip
8     // linking the library, allowing the crate to be compiled, but not linked.
9     println!("cargo:rerun-if-env-changed=CROSVM_BUILD_VARIANT");
10     if std::env::var("CROSVM_BUILD_VARIANT").unwrap_or_default() == "chromeos" {
11         pkg_config::probe_library("libvda").unwrap();
12         println!("cargo:rustc-link-lib=dylib=vda");
13     }
14 }
15