41 lines
1.3 KiB
Rust
Raw Normal View History

2016-12-29 23:28:11 -05:00
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[macro_use]
extern crate build_helper;
2016-12-29 23:28:11 -05:00
extern crate cmake;
use std::env;
use std::fs::File;
use build_helper::native_lib_boilerplate;
2016-12-29 23:28:11 -05:00
use cmake::Config;
fn main() {
if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
let native = native_lib_boilerplate("compiler-rt", "msan", "clang_rt.msan-x86_64",
"rustbuild.timestamp", "build/lib/linux");
if native.skip_build {
return
}
Config::new(&native.src_dir)
2016-12-29 23:28:11 -05:00
.define("COMPILER_RT_BUILD_SANITIZERS", "ON")
.define("COMPILER_RT_BUILD_BUILTINS", "OFF")
.define("COMPILER_RT_BUILD_XRAY", "OFF")
.define("LLVM_CONFIG_PATH", llvm_config)
.out_dir(&native.out_dir)
2016-12-29 23:28:11 -05:00
.build_target("msan")
.build();
t!(File::create(&native.timestamp));
2016-12-29 23:28:11 -05:00
}
}