Browse Source

Add tests for define and include

add-rc-path
Alex Crichton 10 years ago
parent
commit
035fd0831f
  1. 3
      gcc-test/build.rs
  2. 1
      gcc-test/src/bar1.c
  3. 4
      gcc-test/src/foo.c
  4. 0
      gcc-test/src/include/foo.h

3
gcc-test/build.rs

@ -3,11 +3,14 @@ extern crate gcc;
fn main() {
gcc::Config::new()
.file("src/foo.c")
.define("FOO", None)
.define("BAR", Some("1"))
.compile("libfoo.a");
gcc::Config::new()
.file("src/bar1.c")
.file("src/bar2.c")
.include("src/include")
.compile("libbar.a");
gcc::Config::new()

1
gcc-test/src/bar1.c

@ -1,4 +1,5 @@
#include <stdint.h>
#include "foo.h"
int32_t bar1() {
return 5;

4
gcc-test/src/foo.c

@ -1,5 +1,9 @@
#include <stdint.h>
#ifdef FOO
#if BAR == 1
int32_t foo() {
return 4;
}
#endif
#endif

0
gcc-test/src/include/foo.h

Loading…
Cancel
Save