diff options
| author | Damien George | 2019-08-23 11:08:20 +1000 |
|---|---|---|
| committer | Damien George | 2019-08-28 12:47:58 +1000 |
| commit | 15b36aa0af238b16d27a4d768d0d2dd462567665 (patch) | |
| tree | aee5fbc2f85506bf7c90457dbb4ae91f153a35d0 | |
| parent | 5789558d60fb6dcf0537a4487444e6f84a408561 (diff) | |
unix/main: Only accept full emit cmd-line options if native enabled.
| -rw-r--r-- | ports/unix/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ports/unix/main.c b/ports/unix/main.c index 004d581bb..c8f083350 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -313,7 +313,11 @@ STATIC int usage(char **argv) { int impl_opts_cnt = 0; printf( " compile-only -- parse and compile only\n" +#if MICROPY_EMIT_NATIVE " emit={bytecode,native,viper} -- set the default code emitter\n" +#else +" emit=bytecode -- set the default code emitter\n" +#endif ); impl_opts_cnt++; #if MICROPY_ENABLE_GC @@ -343,10 +347,12 @@ STATIC void pre_process_options(int argc, char **argv) { compile_only = true; } else if (strcmp(argv[a + 1], "emit=bytecode") == 0) { emit_opt = MP_EMIT_OPT_BYTECODE; + #if MICROPY_EMIT_NATIVE } else if (strcmp(argv[a + 1], "emit=native") == 0) { emit_opt = MP_EMIT_OPT_NATIVE_PYTHON; } else if (strcmp(argv[a + 1], "emit=viper") == 0) { emit_opt = MP_EMIT_OPT_VIPER; + #endif #if MICROPY_ENABLE_GC } else if (strncmp(argv[a + 1], "heapsize=", sizeof("heapsize=") - 1) == 0) { char *end; |
