From 84ac1d4e29c2742633dae103323370b6c1356cc3 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Thu, 28 Oct 2021 12:49:56 -0500 Subject: [PATCH] added explicit 'compile' option --- src/onyx.c | 9 ++++++++- src/wasm_runtime.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/onyx.c b/src/onyx.c index fb02bef8..371c7e23 100644 --- a/src/onyx.c +++ b/src/onyx.c @@ -31,7 +31,10 @@ static const char* docstring = "Onyx compiler version " VERSION "\n" "The compiler for the Onyx programming language, created by Brendan Hansen.\n" "\n" "Usage:\n" - "\tonyx [-o ] [--verbose] \n" + "\tonyx compile [-o ] [--verbose] \n" +#ifdef ENABLE_RUN_WITH_WASMER + "\tonyx run -- \n" +#endif // "\tonyx doc \n" "\tonyx help\n" "\n" @@ -90,6 +93,10 @@ static CompileOptions compile_opts_parse(bh_allocator alloc, int argc, char *arg i32 arg_parse_start = 1; if (!strcmp(argv[1], "help")) options.action = ONYX_COMPILE_ACTION_PRINT_HELP; + if (!strcmp(argv[1], "compile")) { + options.action = ONYX_COMPILE_ACTION_COMPILE; + arg_parse_start = 2; + } #ifdef ENABLE_RUN_WITH_WASMER else if (!strcmp(argv[1], "run")) { options.action = ONYX_COMPILE_ACTION_RUN; diff --git a/src/wasm_runtime.c b/src/wasm_runtime.c index 792cba32..bb96e99e 100644 --- a/src/wasm_runtime.c +++ b/src/wasm_runtime.c @@ -4,7 +4,7 @@ #include "wasmer.h" #ifndef WASMER_VERSION - #error "Currently, building the Onyx compile with built-in execution support requires the Wasmer library to be compiled and linked." + #error "Currently, building the Onyx compiler with built-in execution support requires the Wasmer library to be compiled and linked." #endif void onyx_run_wasm(bh_buffer wasm_bytes) { -- 2.25.1