Ensure json output is linked
@@ -119,22 +119,19 @@ fn main() {
// emit phase
for contract in &contracts {
if matches.is_present("CFG") {
- println!("{}\n", contract.to_string());
+ println!("{}", contract.to_string());
+ continue;
}
let abi = contract.generate_abi();
let contract = emit::Contract::new(contract, &filename);
- if matches.is_present("JSON") {
- json_contracts.insert(contract.name.to_owned(), JsonContract{
- abi,
- ewasm: EwasmContract{
- wasm: hex::encode_upper(contract.wasm().unwrap())
- }
- });
- } else if matches.is_present("LLVM") {
+
+ if matches.is_present("LLVM") {
contract.dump_llvm();
- } else {
+ continue;
+ }
+
let mut obj = match contract.wasm() {
Ok(o) => o,
Err(s) => {
@@ -147,6 +144,14 @@ fn main() {
obj = link::link(&obj);
}
+ if matches.is_present("JSON") {
+ json_contracts.insert(contract.name.to_owned(), JsonContract{
+ abi,
+ ewasm: EwasmContract{
+ wasm: hex::encode_upper(obj)
+ }
+ });
+ } else {
let wasm_filename = contract.name.to_string() + ".wasm";
let mut file = File::create(wasm_filename).unwrap();
