Skip to content

Commit eeb403f

Browse files
author
MarkuSchick
committed
feat: update circom compiler settings
1 parent caa4234 commit eeb403f

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/configParser.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ export class ConfigParser {
164164
r1cs: true,
165165
json: false,
166166
prime: false,
167-
O: 0,
167+
c: false,
168+
wat: false,
169+
O: c.compileOptions ? c.compileOptions.O : 0,
168170
verbose: false,
169171
},
170172
};

src/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export type BuildCircuitInfo = {
1919
powerOfTauFp?: string;
2020
proofType?: SnarkType;
2121
compilationMode?: CompilationMode;
22+
compileOptions?: CompileOptions;
2223
};
2324

2425
export type CompilationMode = 'wasm' | 'c';
@@ -75,6 +76,8 @@ export type CompileOptions = {
7576
sym: boolean;
7677
r1cs: boolean;
7778
json: boolean;
79+
c: boolean;
80+
wat: boolean;
7881
prime: number | boolean;
7982
O: number;
8083
verbose: boolean;

src/vendors/circom_tester/wasm/tester.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,13 @@ async function compile(fileName, options) {
8787
if (options.sym) flags += '--sym ';
8888
if (options.r1cs) flags += '--r1cs ';
8989
if (options.json) flags += '--json ';
90+
if (options.wat) flags += '--wat ';
91+
if (options.c) flags += '--c ';
9092
if (options.output) flags += '--output ' + options.output + ' ';
9193
if (options.prime) flags += '--prime ' + options.prime + ' ';
9294
if (options.O === 0) flags += '--O0 ';
9395
if (options.O === 1) flags += '--O1 ';
96+
if (options.O === 2) flags += '--O2 ';
9497
if (options.verbose) flags += '--verbose ';
9598

9699
try {

0 commit comments

Comments
 (0)