diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-16 12:30:22 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-16 12:30:22 -0800 |
commit | 153f2d93520f37525f30a3808b969c5533387a3c (patch) | |
tree | 93d691925a910406f0eb5cd0edfa48da4401b43b /system/include | |
parent | 6334c3dd9814ef4174baadd0a4ecfed572596b72 (diff) |
RETAIN_COMPILER_SETTINGS, Runtime.getCompilerSetting and emscripten_get_compiler_setting - an optional way to look up compiler flags at runtime
Diffstat (limited to 'system/include')
-rw-r--r-- | system/include/emscripten/emscripten.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h index eb5ded91..426206c4 100644 --- a/system/include/emscripten/emscripten.h +++ b/system/include/emscripten/emscripten.h @@ -420,6 +420,27 @@ int emscripten_get_worker_queue_size(worker_handle worker); #define EMSCRIPTEN_NETWORK_WEBRTC 1 void emscripten_set_network_backend(int backend); +/* + * Returns the value of a compiler setting. For example + * + * emscripten_get_compiler_setting("PRECISE_F32") + * + * will return an integer representing the value of + * PRECISE_F32 during compilation. For values containing + * anything other than an integer, a string is returned + * (you will need to cast the int return value to a char*). + * + * Some useful things this can do is provide the + * version of emscripten ("EMSCRIPTEN_VERSION"), the optimization + * level ("OPT_LEVEL"), debug level ("DEBUG_LEVEL"), etc. + * + * For this command to work, you must build with + * -s RETAIN_COMPILER_SETTINGS=1 + * as otherwise we do not want to increase the build size + * with this metadata. + */ +int emscripten_get_compiler_setting(const char *name); + /* Internal APIs. Be careful with these. */ /* |