unix/main: Only accept full emit cmd-line options if native enabled.
This commit is contained in:
parent
5789558d60
commit
15b36aa0af
@ -313,7 +313,11 @@ STATIC int usage(char **argv) {
|
|||||||
int impl_opts_cnt = 0;
|
int impl_opts_cnt = 0;
|
||||||
printf(
|
printf(
|
||||||
" compile-only -- parse and compile only\n"
|
" compile-only -- parse and compile only\n"
|
||||||
|
#if MICROPY_EMIT_NATIVE
|
||||||
" emit={bytecode,native,viper} -- set the default code emitter\n"
|
" emit={bytecode,native,viper} -- set the default code emitter\n"
|
||||||
|
#else
|
||||||
|
" emit=bytecode -- set the default code emitter\n"
|
||||||
|
#endif
|
||||||
);
|
);
|
||||||
impl_opts_cnt++;
|
impl_opts_cnt++;
|
||||||
#if MICROPY_ENABLE_GC
|
#if MICROPY_ENABLE_GC
|
||||||
@ -343,10 +347,12 @@ STATIC void pre_process_options(int argc, char **argv) {
|
|||||||
compile_only = true;
|
compile_only = true;
|
||||||
} else if (strcmp(argv[a + 1], "emit=bytecode") == 0) {
|
} else if (strcmp(argv[a + 1], "emit=bytecode") == 0) {
|
||||||
emit_opt = MP_EMIT_OPT_BYTECODE;
|
emit_opt = MP_EMIT_OPT_BYTECODE;
|
||||||
|
#if MICROPY_EMIT_NATIVE
|
||||||
} else if (strcmp(argv[a + 1], "emit=native") == 0) {
|
} else if (strcmp(argv[a + 1], "emit=native") == 0) {
|
||||||
emit_opt = MP_EMIT_OPT_NATIVE_PYTHON;
|
emit_opt = MP_EMIT_OPT_NATIVE_PYTHON;
|
||||||
} else if (strcmp(argv[a + 1], "emit=viper") == 0) {
|
} else if (strcmp(argv[a + 1], "emit=viper") == 0) {
|
||||||
emit_opt = MP_EMIT_OPT_VIPER;
|
emit_opt = MP_EMIT_OPT_VIPER;
|
||||||
|
#endif
|
||||||
#if MICROPY_ENABLE_GC
|
#if MICROPY_ENABLE_GC
|
||||||
} else if (strncmp(argv[a + 1], "heapsize=", sizeof("heapsize=") - 1) == 0) {
|
} else if (strncmp(argv[a + 1], "heapsize=", sizeof("heapsize=") - 1) == 0) {
|
||||||
char *end;
|
char *end;
|
||||||
|
Loading…
Reference in New Issue
Block a user