aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc-test/build.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2017-09-16 08:37:31 -0700
committerDaniel Mueller <deso@posteo.net>2017-09-16 08:37:31 -0700
commitab3c2a935b1ba655de2f3fec35da2c14b69966dc (patch)
treecb546a86fe9648b2afcd78776d7e035a05c04b76 /gcc/gcc-test/build.rs
parentea4ea0e5fced2780c569b2e420e56f47f62adca8 (diff)
downloadnitrocli-ab3c2a935b1ba655de2f3fec35da2c14b69966dc.tar.gz
nitrocli-ab3c2a935b1ba655de2f3fec35da2c14b69966dc.tar.bz2
Update gcc crate to 0.3.54
Import subrepo gcc/:gcc at dc329205d54b53a45ab66368aed265b68fe7f261
Diffstat (limited to 'gcc/gcc-test/build.rs')
-rw-r--r--gcc/gcc-test/build.rs32
1 files changed, 18 insertions, 14 deletions
diff --git a/gcc/gcc-test/build.rs b/gcc/gcc-test/build.rs
index f81833b..e6308ed 100644
--- a/gcc/gcc-test/build.rs
+++ b/gcc/gcc-test/build.rs
@@ -9,36 +9,38 @@ fn main() {
fs::remove_dir_all(&out).unwrap();
fs::create_dir(&out).unwrap();
- gcc::Config::new()
+ gcc::Build::new()
.file("src/foo.c")
+ .flag_if_supported("-Wall")
+ .flag_if_supported("-Wfoo-bar-this-flag-does-not-exist")
.define("FOO", None)
- .define("BAR", Some("1"))
- .compile("libfoo.a");
+ .define("BAR", "1")
+ .compile("foo");
- gcc::Config::new()
+ gcc::Build::new()
.file("src/bar1.c")
.file("src/bar2.c")
.include("src/include")
- .compile("libbar.a");
+ .compile("bar");
let target = std::env::var("TARGET").unwrap();
let file = target.split("-").next().unwrap();
let file = format!("src/{}.{}",
file,
if target.contains("msvc") { "asm" } else { "S" });
- gcc::Config::new()
+ gcc::Build::new()
.file(file)
- .compile("libasm.a");
+ .compile("asm");
- gcc::Config::new()
+ gcc::Build::new()
.file("src/baz.cpp")
.cpp(true)
- .compile("libbaz.a");
+ .compile("baz");
if target.contains("windows") {
- gcc::Config::new()
+ gcc::Build::new()
.file("src/windows.c")
- .compile("libwindows.a");
+ .compile("windows");
}
// Test that the `windows_registry` module will set PATH by looking for
@@ -50,6 +52,7 @@ fn main() {
println!("nmake 1");
let status = gcc::windows_registry::find(&target, "nmake.exe")
.unwrap()
+ .env_remove("MAKEFLAGS")
.arg("/fsrc/NMakefile")
.env("OUT_DIR", &out)
.status()
@@ -66,6 +69,7 @@ fn main() {
println!("nmake 2");
let status = gcc::windows_registry::find(&target, "nmake.exe")
.unwrap()
+ .env_remove("MAKEFLAGS")
.arg("/fsrc/NMakefile")
.env("OUT_DIR", &out)
.status()
@@ -77,12 +81,12 @@ fn main() {
// This tests whether we can build a library but not link it to the main
// crate. The test module will do its own linking.
- gcc::Config::new()
+ gcc::Build::new()
.cargo_metadata(false)
.file("src/opt_linkage.c")
- .compile("libOptLinkage.a");
+ .compile("OptLinkage");
- let out = gcc::Config::new()
+ let out = gcc::Build::new()
.file("src/expand.c")
.expand();
let out = String::from_utf8(out).unwrap();