Add compile logic to ui
This commit is contained in:
@@ -35,10 +35,11 @@ export const compileCode = async (activeId: number) => {
|
||||
body: JSON.stringify({
|
||||
output: "wasm",
|
||||
compress: true,
|
||||
strip: state.compileOptions.strip,
|
||||
files: [
|
||||
{
|
||||
type: "c",
|
||||
options: state.compileOptions || '-O0',
|
||||
options: state.compileOptions.optimisationLevel || '-O0',
|
||||
name: state.files[activeId].name,
|
||||
src: state.files[activeId].content,
|
||||
},
|
||||
|
||||
@@ -74,7 +74,10 @@ export interface IState {
|
||||
mainModalOpen: boolean;
|
||||
mainModalShowed: boolean;
|
||||
accounts: IAccount[];
|
||||
compileOptions: '-O0' | '-O1' | '-O2' | '-O3' | '-O4' | '-Os';
|
||||
compileOptions: {
|
||||
optimisationLevel: '-O0' | '-O1' | '-O2' | '-O3' | '-O4' | '-Os';
|
||||
strip: boolean
|
||||
}
|
||||
}
|
||||
|
||||
// let localStorageState: null | string = null;
|
||||
@@ -104,7 +107,10 @@ let initialState: IState = {
|
||||
mainModalOpen: false,
|
||||
mainModalShowed: false,
|
||||
accounts: [],
|
||||
compileOptions: '-O0'
|
||||
compileOptions: {
|
||||
optimisationLevel: '-O0',
|
||||
strip: false
|
||||
}
|
||||
};
|
||||
|
||||
let localStorageAccounts: string | null = null;
|
||||
|
||||
Reference in New Issue
Block a user