diff options
author | Damien George <damien.p.george@gmail.com> | 2019-08-23 11:09:34 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-08-28 12:47:58 +1000 |
commit | 8e3e05761e1143a2502c7eca07c1b22bac192c84 (patch) | |
tree | bc448959785d5c0d5c8ddd0d51d59428df573687 /mpy-cross/main.c | |
parent | 15b36aa0af238b16d27a4d768d0d2dd462567665 (diff) |
mpy-cross/main: Only accept full emit cmdline options if native enabled.
Diffstat (limited to 'mpy-cross/main.c')
-rw-r--r-- | mpy-cross/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mpy-cross/main.c b/mpy-cross/main.c index 970ad2d75..6312a7746 100644 --- a/mpy-cross/main.c +++ b/mpy-cross/main.c @@ -115,7 +115,11 @@ STATIC int usage(char **argv) { ); int impl_opts_cnt = 0; printf( +#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++; printf( @@ -140,10 +144,12 @@ STATIC void pre_process_options(int argc, char **argv) { } 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 } else if (strncmp(argv[a + 1], "heapsize=", sizeof("heapsize=") - 1) == 0) { char *end; heap_size = strtol(argv[a + 1] + sizeof("heapsize=") - 1, &end, 0); |