2019-07-15 13:17:17 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Solana SDK-C
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								This crate exposes a C API to Solana functions written in Rust. The crate generates a static library, and uses `cbindgen`
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								to generate a header file during the build. To generate both:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								```shell
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								$ cd <path/to/solana/repo>/sdk-c
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-01 13:33:30 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								$ SOLANA_H_OUT_DIR="$(pwd)/include" cargo build
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-15 13:17:17 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								```
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								This will generate the static library in `<path/to/solana/repo>/target/deps` and the header file in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								`<path/to/solana/repo>/sdk-c/include`.
							 |