forked from mirrors/gecko-dev
This updates binjs_meta and thus weedle, bindgen and thus clang-sys transitively, and the mime / mime_guess crate and thus unicase and version-check. Differential Revision: https://phabricator.services.mozilla.com/D66282 --HG-- rename : third_party/rust/lmdb-rkv-sys/tests/fixtures/testdb/lock.mdb => third_party/rust/lmdb-rkv-sys/tests/fixtures/testdb-32/lock.mdb rename : third_party/rust/mime_guess/Cargo.lock => third_party/rust/nom/Cargo.lock rename : third_party/rust/nom/src/branch.rs => third_party/rust/nom/src/branch/macros.rs rename : third_party/rust/nom/src/sequence.rs => third_party/rust/nom/src/sequence/macros.rs rename : third_party/rust/rkv-0.10.2/.cargo-checksum.json => third_party/rust/rkv-0.10.4/.cargo-checksum.json rename : third_party/rust/rkv-0.10.2/CODE_OF_CONDUCT.md => third_party/rust/rkv-0.10.4/CODE_OF_CONDUCT.md rename : third_party/rust/rkv-0.10.2/Cargo.toml => third_party/rust/rkv-0.10.4/Cargo.toml rename : third_party/rust/rkv-0.10.2/LICENSE => third_party/rust/rkv-0.10.4/LICENSE rename : third_party/rust/rkv-0.10.2/examples/README.md => third_party/rust/rkv-0.10.4/examples/README.md rename : third_party/rust/rkv-0.10.2/examples/iterator.rs => third_party/rust/rkv-0.10.4/examples/iterator.rs rename : third_party/rust/rkv-0.10.2/examples/simple-store.rs => third_party/rust/rkv-0.10.4/examples/simple-store.rs rename : third_party/rust/rkv-0.10.2/run-all-examples.sh => third_party/rust/rkv-0.10.4/run-all-examples.sh rename : third_party/rust/rkv-0.10.2/src/bin/dump.rs => third_party/rust/rkv-0.10.4/src/bin/dump.rs rename : third_party/rust/rkv-0.10.2/src/bin/rand.rs => third_party/rust/rkv-0.10.4/src/bin/rand.rs rename : third_party/rust/rkv-0.10.2/src/env.rs => third_party/rust/rkv-0.10.4/src/env.rs rename : third_party/rust/rkv-0.10.2/src/error.rs => third_party/rust/rkv-0.10.4/src/error.rs rename : third_party/rust/rkv-0.10.2/src/lib.rs => third_party/rust/rkv-0.10.4/src/lib.rs rename : third_party/rust/rkv-0.10.2/src/manager.rs => third_party/rust/rkv-0.10.4/src/manager.rs rename : third_party/rust/rkv-0.10.2/src/migrate.rs => third_party/rust/rkv-0.10.4/src/migrate.rs rename : third_party/rust/rkv-0.10.2/src/readwrite.rs => third_party/rust/rkv-0.10.4/src/readwrite.rs rename : third_party/rust/rkv-0.10.2/src/store.rs => third_party/rust/rkv-0.10.4/src/store.rs rename : third_party/rust/rkv-0.10.2/src/store/integer.rs => third_party/rust/rkv-0.10.4/src/store/integer.rs rename : third_party/rust/rkv-0.10.2/src/store/integermulti.rs => third_party/rust/rkv-0.10.4/src/store/integermulti.rs rename : third_party/rust/rkv-0.10.2/src/store/multi.rs => third_party/rust/rkv-0.10.4/src/store/multi.rs rename : third_party/rust/rkv-0.10.2/src/store/single.rs => third_party/rust/rkv-0.10.4/src/store/single.rs rename : third_party/rust/rkv-0.10.2/src/value.rs => third_party/rust/rkv-0.10.4/src/value.rs rename : third_party/rust/rkv-0.10.2/tests/integer-store.rs => third_party/rust/rkv-0.10.4/tests/integer-store.rs rename : third_party/rust/rkv-0.10.2/tests/manager.rs => third_party/rust/rkv-0.10.4/tests/manager.rs rename : third_party/rust/rkv-0.10.2/tests/multi-integer-store.rs => third_party/rust/rkv-0.10.4/tests/multi-integer-store.rs rename : third_party/rust/rkv-0.10.2/tests/test_txn.rs => third_party/rust/rkv-0.10.4/tests/test_txn.rs extra : moz-landing-system : lando
85 lines
2.6 KiB
Rust
85 lines
2.6 KiB
Rust
// Copyright 2016 Kyle Mayes
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
//! Finds `libclang` static or dynamic libraries and links to them.
|
|
//!
|
|
//! # Environment Variables
|
|
//!
|
|
//! This build script can make use of several environment variables to help it
|
|
//! find the required static or dynamic libraries.
|
|
//!
|
|
//! * `LLVM_CONFIG_PATH` - provides a path to an `llvm-config` executable
|
|
//! * `LIBCLANG_PATH` - provides a path to a directory containing a `libclang`
|
|
//! shared library or a path to a specific `libclang` shared library
|
|
//! * `LIBCLANG_STATIC_PATH` - provides a path to a directory containing LLVM
|
|
//! and Clang static libraries
|
|
|
|
#![allow(unused_attributes)]
|
|
|
|
extern crate glob;
|
|
|
|
use std::path::Path;
|
|
|
|
#[path = "build/common.rs"]
|
|
pub mod common;
|
|
#[path = "build/dynamic.rs"]
|
|
pub mod dynamic;
|
|
#[path = "build/static.rs"]
|
|
pub mod static_;
|
|
|
|
/// Copy the file from the supplied source to the supplied destination.
|
|
#[cfg(feature = "runtime")]
|
|
fn copy(source: &str, destination: &Path) {
|
|
use std::fs::File;
|
|
use std::io::{Read, Write};
|
|
|
|
let mut string = String::new();
|
|
File::open(source)
|
|
.unwrap()
|
|
.read_to_string(&mut string)
|
|
.unwrap();
|
|
File::create(destination)
|
|
.unwrap()
|
|
.write_all(string.as_bytes())
|
|
.unwrap();
|
|
}
|
|
|
|
/// Generates the finding and linking code so that it may be used at runtime.
|
|
#[cfg(feature = "runtime")]
|
|
fn main() {
|
|
use std::env;
|
|
|
|
if cfg!(feature = "static") {
|
|
panic!("`runtime` and `static` features can't be combined");
|
|
}
|
|
|
|
let out = env::var("OUT_DIR").unwrap();
|
|
copy("build/common.rs", &Path::new(&out).join("common.rs"));
|
|
copy("build/dynamic.rs", &Path::new(&out).join("dynamic.rs"));
|
|
}
|
|
|
|
/// Finds and links to the required libraries.
|
|
#[cfg(not(feature = "runtime"))]
|
|
fn main() {
|
|
if cfg!(feature = "static") {
|
|
static_::link();
|
|
} else {
|
|
dynamic::link();
|
|
}
|
|
|
|
if let Some(output) = common::run_llvm_config(&["--includedir"]) {
|
|
let directory = Path::new(output.trim_end());
|
|
println!("cargo:include={}", directory.display());
|
|
}
|
|
}
|