-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c60f856
commit fa33b55
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use std::process::Command; | ||
|
||
/// Compiles a Cairo0 program using the deprecated compiler. | ||
pub fn cairo0_compile(path: String, extra_arg: Option<String>, debug_info: bool) -> Vec<u8> { | ||
let mut command = Command::new("starknet-compile-deprecated"); | ||
command.arg(&path); | ||
if let Some(extra_arg) = extra_arg { | ||
command.arg(extra_arg); | ||
} | ||
if !debug_info { | ||
command.arg("--no_debug_info"); | ||
} | ||
let compile_output = command.output().unwrap(); | ||
let stderr_output = String::from_utf8(compile_output.stderr).unwrap(); | ||
assert!(compile_output.status.success(), "{stderr_output}"); | ||
compile_output.stdout | ||
} | ||
|
||
/// Compiles a Cairo1 program using the compiler version set in the Cargo.toml. | ||
pub fn cairo1_compile(_path: String) -> Vec<u8> { | ||
todo!(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.