summaryrefslogtreecommitdiffstatshomepage
path: root/mpy-cross
diff options
context:
space:
mode:
authorDavid CARLIER <devnexen@gmail.com>2021-01-16 20:48:19 +0000
committerDamien George <damien@micropython.org>2021-01-30 15:13:24 +1100
commitcb30928ac8da931f905d1c14468498d21108933a (patch)
tree336741629540e297f51e132380dde126702b504d /mpy-cross
parentcb8e2f02ab34b49e5bd42012f3bc9adf61607b25 (diff)
downloadmicropython-cb30928ac8da931f905d1c14468498d21108933a.tar.gz
micropython-cb30928ac8da931f905d1c14468498d21108933a.zip
py/persistentcode: Introduce MICROPY_PERSISTENT_CODE_SAVE_FILE option.
This should be enabled when the mp_raw_code_save_file function is needed. It is enabled for mpy-cross, and a check for defined(__APPLE__) is added to cover Mac M1 systems.
Diffstat (limited to 'mpy-cross')
-rw-r--r--mpy-cross/mpconfigport.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/mpy-cross/mpconfigport.h b/mpy-cross/mpconfigport.h
index 21d3e12ed4..7ff3d1b6b4 100644
--- a/mpy-cross/mpconfigport.h
+++ b/mpy-cross/mpconfigport.h
@@ -30,6 +30,14 @@
#define MICROPY_PERSISTENT_CODE_LOAD (0)
#define MICROPY_PERSISTENT_CODE_SAVE (1)
+#ifndef MICROPY_PERSISTENT_CODE_SAVE_FILE
+#if defined(__i386__) || defined(__x86_64__) || defined(_WIN32) || defined(__unix__) || defined(__APPLE__)
+#define MICROPY_PERSISTENT_CODE_SAVE_FILE (1)
+#else
+#define MICROPY_PERSISTENT_CODE_SAVE_FILE (0)
+#endif
+#endif
+
#define MICROPY_EMIT_X64 (1)
#define MICROPY_EMIT_X86 (1)
#define MICROPY_EMIT_THUMB (1)