feature gated occlum library and tonic build config
This commit is contained in:
		
							parent
							
								
									418e1b9dbf
								
							
						
					
					
						commit
						b535df88d5
					
				
							
								
								
									
										16
									
								
								build.rs
									
									
									
									
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										16
									
								
								build.rs
									
									
									
									
									
								
							| @ -1,13 +1,17 @@ | |||||||
| fn main() { | fn main() { | ||||||
|     // TODO: make this conditional on occlum feature
 |  | ||||||
|     // TODO: should be conditional on the target platform (musl vs glibc)
 |     // TODO: should be conditional on the target platform (musl vs glibc)
 | ||||||
|     println!("cargo:rustc-link-search=/opt/occlum/toolchains/dcap_lib/musl"); |  | ||||||
|     // Cargo will automatically know it must look for `libocclum_dcap.a`
 |  | ||||||
|     println!("cargo:rustc-link-lib=occlum_dcap"); |  | ||||||
| 
 | 
 | ||||||
|     // TODO: make this conditional if compiling grpcs examples
 |     #[cfg(feature = "occlum")] | ||||||
|  |     { | ||||||
|  |         println!("cargo:rustc-link-search=/opt/occlum/toolchains/dcap_lib/musl"); | ||||||
|  |         println!("cargo:rustc-link-lib=occlum_dcap"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     // Cargo will automatically know it must look for `libocclum_dcap.a`
 | ||||||
|  | 
 | ||||||
|  |     #[cfg(feature = "tonic")] | ||||||
|     tonic_build::configure() |     tonic_build::configure() | ||||||
|         .build_server(true) |         .build_server(true) | ||||||
|         .compile(&["examples/echo.proto"], &["examples"]) |         .compile_protos(&["examples/echo.proto"], &["examples"]) | ||||||
|         .unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e)); |         .unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e)); | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user