File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1
1
extern crate capnpc;
2
2
3
3
fn main ( ) {
4
- :: capnpc:: compile ( Path :: new ( "." ) , [ Path :: new ( "test.capnp" ) ] ) ;
4
+
5
+ // See https://github.com/rust-lang/cargo/issues/879
6
+ //::capnpc::compile(Path::new("."), [Path::new("test.capnp")]);
7
+
8
+ let mut command = :: std:: io:: Command :: new ( "capnp" ) ;
9
+ command
10
+ . arg ( "compile" )
11
+ . arg ( "-o/bin/cat" )
12
+ . arg ( "test.capnp" ) ;
13
+
14
+ command. stdout ( :: std:: io:: process:: CreatePipe ( false , true ) ) ;
15
+
16
+ match command. spawn ( ) {
17
+ Ok ( ref mut p) => {
18
+ let mut child_stdout = p. stdout . take ( ) . unwrap ( ) ;
19
+ :: capnpc:: codegen:: main ( & mut child_stdout) . unwrap ( ) ;
20
+ p. wait ( ) . unwrap ( ) ;
21
+ }
22
+ Err ( e) => {
23
+ panic ! ( "could not start process: {}" , e) ;
24
+ }
25
+ }
26
+
5
27
}
Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ extern crate capnp;
10
10
11
11
#[ allow( overflowing_literals) ]
12
12
pub mod test_capnp {
13
- include ! ( concat!( env!( "OUT_DIR" ) , "/test_capnp.rs" ) )
13
+ // See https://github.com/rust-lang/cargo/issues/879
14
+ // include!(concat!(env!("OUT_DIR"), "/test_capnp.rs"))
15
+ include ! ( "test_capnp.rs" )
14
16
}
15
17
16
18
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments