blob: ff6279b5d0701d71b0366c97570a01db65ce4cf4 [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
extern crate cc;
use std::env;
// TODO(stange): Figure out how to avoid requiring users to use GCC to build
// a binding.c
fn main() {
let fuchsia_root = match env::var("FUCHSIA_ROOT") {
Ok(val) => val,
Err(error) => panic!("Please set FUCHSIA_ROOT {}", error),
};
cc::Build::new()
.file("src/binding.c")
.compiler(format!("{}/buildtools/linux-x64/clang/bin/clang", fuchsia_root))
.flag(format!("--sysroot={}/out/build-zircon/build-x64/sysroot", fuchsia_root).as_str())
.compile("libbinding.a");
}