// Settings that control the emscripten compiler. These are available to the1// python code and also as global variables when the JS compiler runs. They2// are set via the command line. For example:3//4// emcc -sOPTION1=VALUE1 -sOPTION2=ITEM1,ITEM2 [..other stuff..]5//6// For convenience and readability ``-sOPTION`` expands to ``-sOPTION=1``7// and ``-sNO_OPTION`` expands to ``-sOPTION=0`` (assuming OPTION is a valid8// option).9//10// See https://github.com/emscripten-core/emscripten/wiki/Code-Generation-Modes/11//12// Note that the values here are the defaults which can be affected either13// directly via ``-s`` flags or indirectly via other options (e.g. -O1,2,3)14//15// These flags should only have an effect when compiling to JS, so there16// should not be a need to have them when just compiling source to17// bitcode. However, there will also be no harm either, so it is ok to.18//19// Settings in this file can be directly set from the command line. Internal20// settings that are not part of the user ABI live in the settings_internal.js.21//22// In general it is best to pass the same arguments at both compile and link23// time, as whether wasm object files are used or not affects when codegen24// happens (without wasm object files, codegen is done entirely during25// link; otherwise, it is during compile). Flags affecting codegen must26// be passed when codegen happens, so to let a build easily switch when codegen27// happens (LTO vs normal), pass the flags at both times. The flags are also28// annotated in this file:29//30// [link] - Should be passed at link time. This is the case for all JS flags,31// as we emit JS at link (and that is most of the flags here, and32// hence the default).33// [compile+link] - A flag that has an effect at both compile and link time,34// basically any time emcc is invoked. The same flag should be35// passed at both times in most cases.36//37// If not otherwise specified, a flag is [link]. Note that no flag is only38// relevant during compile time, as during link we may do codegen for system39// libraries and other support code, so all flags are either link or40// compile+link.41//4243// Tuning4445// Whether we should add runtime assertions. This affects both JS and how46// system libraries are built.47// ASSERTIONS == 2 gives even more runtime checks, that may be very slow. That48// includes internal dlmalloc assertions, for example.49// ASSERTIONS defaults to 0 in optimized builds (-O1 and above).50// [link]51var ASSERTIONS = 1;5253// Chooses what kind of stack smash checks to emit to generated code:54// Building with ASSERTIONS=1 causes STACK_OVERFLOW_CHECK default to 1.55// Since ASSERTIONS=1 is the default at -O0, which itself is the default56// optimization level this means that this setting also effectively57// defaults to 1, absent any other settings:58//59// - 0: Stack overflows are not checked.60// - 1: Adds a security cookie at the top of the stack, which is checked at end61// of each tick and at exit (practically zero performance overhead)62// - 2: Same as above, but also runs a binaryen pass which adds a check to all63// stack pointer assignments. Has a small performance cost.64//65// [link]66var STACK_OVERFLOW_CHECK = 0;6768// When :ref`STACK_OVERFLOW_CHECK` is enabled we also check writes to address69// zero. This can help detect NULL pointer usage. If you want to skip this70// extra check (for example, if you want reads from the address zero to always71// return zero) you can disable this here. This setting has no effect when72// :ref:`STACK_OVERFLOW_CHECK` is disabled.73var CHECK_NULL_WRITES = true;7475// When set to 1, will generate more verbose output during compilation.76// [general]77var VERBOSE = false;7879// Whether we will run the main() function. Disable if you embed the generated80// code in your own, and will call main() yourself at the right time (which you81// can do with Module.callMain(), with an optional parameter of commandline args).82// [link]83var INVOKE_RUN = true;8485// If 0, support for shutting down the runtime is not emitted into the build.86// This means that the program is not quit when main() completes, but execution87// will yield to the event loop of the JS environment, allowing event handlers88// to run afterwards. If 0, C++ global destructors will not be emitted into the89// build either, to save on code size. Calling exit() will throw an unwinding90// exception, but will not shut down the runtime.91//92// Set this to 1 if you do want to retain the ability to shut down the program.93// If 1, then completing main() will by default call exit(), unless a refcount94// keeps the runtime alive. Call emscripten_exit_with_live_runtime() to finish95// main() while keeping the runtime alive. Calling emscripten_force_exit() will96// shut down the runtime, invoking atexit()s, and flushing stdio streams.97// This setting is controlled automatically in :ref:`STANDALONE_WASM` mode:98//99// - For a command (has a main function) this is always 1100// - For a reactor (no main function) this is always 0101//102// For more details, see documentation for emscripten_force_exit() and103// emscripten_exit_with_live_runtime().104// [link]105var EXIT_RUNTIME = false;106107// The total stack size. There is no way to enlarge the stack, so this108// value must be large enough for the program's requirements. If109// assertions are on, we will assert on not exceeding this, otherwise,110// it will fail silently.111// [link]112var STACK_SIZE = 64*1024;113114// What malloc()/free() to use, out of:115//116// - dlmalloc - a powerful general-purpose malloc117// - emmalloc - a simple and compact malloc designed for emscripten118// - emmalloc-debug - use emmalloc and add extra assertion checks119// - emmalloc-memvalidate - use emmalloc with assertions+heap consistency120// checking.121// - emmalloc-verbose - use emmalloc with assertions + verbose logging.122// - emmalloc-memvalidate-verbose - use emmalloc with assertions + heap123// consistency checking + verbose logging.124// - mimalloc - a powerful multithreaded allocator. This is recommended in125// large applications that have malloc() contention, but it is126// larger and uses more memory.127// - none - no malloc() implementation is provided, but you must implement128// malloc() and free() yourself.129//130// dlmalloc is necessary for split memory and other special modes, and will be131// used automatically in those cases.132// In general, if you don't need one of those special modes, and if you don't133// allocate very many small objects, you should use emmalloc since it's134// smaller. Otherwise, if you do allocate many small objects, dlmalloc135// is usually worth the extra size. dlmalloc is also a good choice if you want136// the extra security checks it does (such as noticing metadata corruption in137// its internal data structures, which emmalloc does not do).138// [link]139var MALLOC = "dlmalloc";140141// If 1, then when malloc would fail we abort(). This is nonstandard behavior,142// but makes sense for the web since we have a fixed amount of memory that143// must all be allocated up front, and so (a) failing mallocs are much more144// likely than on other platforms, and (b) people need a way to find out145// how big that initial allocation (INITIAL_MEMORY) must be.146// If you set this to 0, then you get the standard malloc behavior of147// returning NULL (0) when it fails.148//149// Setting ALLOW_MEMORY_GROWTH turns this off, as in that mode we default to150// the behavior of trying to grow and returning 0 from malloc on failure, like151// a standard system would. However, you can still set this flag to override152// that. This is a mostly-backwards-compatible change. Previously this option153// was ignored when growth was on. The current behavior is that growth turns it154// off by default, so for users that never specified the flag nothing changes.155// But if you do specify it, it will have an effect now, which it did not156// previously. If you don't want that, just stop passing it in at link time.157//158// Note that this setting does not affect the behavior of operator new in C++.159// This function will always abort on allocation failure if exceptions are160// disabled.161// If you want new to return 0 on failure, use it with std::nothrow.162//163// [link]164var ABORTING_MALLOC = true;165166// The initial amount of heap memory available to the program. This is the167// memory region available for dynamic allocations via `sbrk`, `malloc` and `new`.168//169// Unlike INITIAL_MEMORY, this setting allows the static and dynamic regions of170// your program's memory to independently grow. In most cases we recommend using171// this setting rather than `INITIAL_MEMORY`. However, this setting does not work172// for imported memories (e.g. when dynamic linking is used).173//174// [link]175var INITIAL_HEAP = 16777216;176177// The initial amount of memory to use. Using more memory than this will178// cause us to expand the heap, which can be costly with typed arrays:179// we need to copy the old heap into a new one in that case.180// If ALLOW_MEMORY_GROWTH is set, this initial amount of memory can increase181// later; if not, then it is the final and total amount of memory.182//183// By default, this value is calculated based on INITIAL_HEAP, STACK_SIZE,184// as well the size of static data in input modules.185//186// (This option was formerly called TOTAL_MEMORY.)187// [link]188var INITIAL_MEMORY = -1;189190// Set the maximum size of memory in the wasm module (in bytes). This is only191// relevant when ALLOW_MEMORY_GROWTH is set, as without growth, the size of192// INITIAL_MEMORY is the final size of memory anyhow.193//194// Note that the default value here is 2GB, which means that by default if you195// enable memory growth then we can grow up to 2GB but no higher. 2GB is a196// natural limit for several reasons:197//198// * If the maximum heap size is over 2GB, then pointers must be unsigned in199// JavaScript, which increases code size. We don't want memory growth builds200// to be larger unless someone explicitly opts in to >2GB+ heaps.201// * Historically no VM has supported more >2GB+, and only recently (Mar 2020)202// has support started to appear. As support is limited, it's safer for203// people to opt into >2GB+ heaps rather than get a build that may not204// work on all VMs.205//206// To use more than 2GB, set this to something higher, like 4GB.207//208// (This option was formerly called WASM_MEM_MAX and BINARYEN_MEM_MAX.)209// [link]210var MAXIMUM_MEMORY = 2147483648;211212// If false, we abort with an error if we try to allocate more memory than213// we can (INITIAL_MEMORY). If true, we will grow the memory arrays at214// runtime, seamlessly and dynamically.215// See https://code.google.com/p/v8/issues/detail?id=3907 regarding216// memory growth performance in chrome.217// Note that growing memory means we replace the JS typed array views, as218// once created they cannot be resized. (In wasm we can grow the Memory, but219// still need to create new views for JS.)220// Setting this option on will disable ABORTING_MALLOC, in other words,221// ALLOW_MEMORY_GROWTH enables fully standard behavior, of both malloc222// returning 0 when it fails, and also of being able to allocate more223// memory from the system as necessary.224// [link]225var ALLOW_MEMORY_GROWTH = false;226227// If ALLOW_MEMORY_GROWTH is true, this variable specifies the geometric228// overgrowth rate of the heap at resize. Specify MEMORY_GROWTH_GEOMETRIC_STEP=0229// to disable overgrowing the heap at all, or e.g.230// MEMORY_GROWTH_GEOMETRIC_STEP=1.0 to double the heap (+100%) at every grow step.231// The larger this value is, the more memory the WebAssembly heap overreserves232// to reduce performance hiccups coming from memory resize, and the smaller233// this value is, the more memory is conserved, at the performance of more234// stuttering when the heap grows. (profiled to be on the order of ~20 msecs)235// [link]236var MEMORY_GROWTH_GEOMETRIC_STEP = 0.20;237238// Specifies a cap for the maximum geometric overgrowth size, in bytes. Use239// this value to constrain the geometric grow to not exceed a specific rate.240// Pass MEMORY_GROWTH_GEOMETRIC_CAP=0 to disable the cap and allow unbounded241// size increases.242// [link]243var MEMORY_GROWTH_GEOMETRIC_CAP = 96*1024*1024;244245// If ALLOW_MEMORY_GROWTH is true and MEMORY_GROWTH_LINEAR_STEP == -1, then246// geometric memory overgrowth is utilized (above variable). Set247// MEMORY_GROWTH_LINEAR_STEP to a multiple of WASM page size (64KB), eg. 16MB to248// replace geometric overgrowth rate with a constant growth step size. When249// MEMORY_GROWTH_LINEAR_STEP is used, the variables MEMORY_GROWTH_GEOMETRIC_STEP250// and MEMORY_GROWTH_GEOMETRIC_CAP are ignored.251// [link]252var MEMORY_GROWTH_LINEAR_STEP = -1;253254// The "architecture" to compile for. 0 means the default wasm32, 1 is255// the full end-to-end wasm64 mode, and 2 is wasm64 for clang/lld but lowered to256// wasm32 in Binaryen (such that it can run on wasm32 engines, while internally257// using i64 pointers).258// Assumes WASM_BIGINT.259// [compile+link]260var MEMORY64 = 0;261262// Sets the initial size of the table when MAIN_MODULE or SIDE_MODULE is used263// (and not otherwise). Normally Emscripten can determine the size of the table264// at link time, but in SPLIT_MODULE mode, wasm-split often needs to grow the265// table, so the table size baked into the JS for the instrumented build will be266// too small after the module is split. This is a hack to allow users to specify267// a large enough table size that can be consistent across both builds. This268// setting may be removed at any time and should not be used except in269// conjunction with SPLIT_MODULE and dynamic linking.270// [link]271var INITIAL_TABLE = -1;272273// If true, allows more functions to be added to the table at runtime. This is274// necessary for dynamic linking, and set automatically in that mode.275// [link]276var ALLOW_TABLE_GROWTH = false;277278// Where global data begins; the start of static memory.279// A GLOBAL_BASE of 1024 or above is useful for optimizing load/store offsets,280// as it enables the --low-memory-unused pass281// [link]282var GLOBAL_BASE = 1024;283284// Where table slots (function addresses) are allocated.285// This must be at least 1 to reserve the zero slot for the null pointer.286// [link]287var TABLE_BASE = 1;288289// Whether closure compiling is being run on this output290// [link]291var USE_CLOSURE_COMPILER = false;292293// Deprecated: Use the standard warnings flags instead. e.g. ``-Wclosure``,294// ``-Wno-closure``, ``-Werror=closure``.295// options: 'quiet', 'warn', 'error'. If set to 'warn', Closure warnings are296// printed out to console. If set to 'error', Closure warnings are treated like297// errors, similar to -Werror compiler flag.298// [link]299// [deprecated]300var CLOSURE_WARNINGS = 'quiet';301302// Ignore closure warnings and errors (like on duplicate definitions)303// [link]304var IGNORE_CLOSURE_COMPILER_ERRORS = false;305306// If set to 1, each wasm module export is individually declared with a307// JavaScript "var" definition. This is the simple and recommended approach.308// However, this does increase code size (especially if you have many such309// exports), which can be avoided in an unsafe way by setting this to 0. In that310// case, no "var" is created for each export, and instead a loop (of small311// constant code size, no matter how many exports you have) writes all the312// exports received into the global scope. Doing so is dangerous since such313// modifications of the global scope can confuse external JS minifier tools, and314// also things can break if the scope the code is in is not the global scope315// (e.g. if you manually enclose them in a function scope).316// [link]317var DECLARE_ASM_MODULE_EXPORTS = true;318319// If set to 1, prevents inlining. If 0, we will inline normally in LLVM.320// This does not affect the inlining policy in Binaryen.321// [compile]322var INLINING_LIMIT = false;323324// If set to 1, perform an acorn pass that converts each HEAP access into a325// function call that uses DataView to enforce LE byte order for HEAP buffer;326// This makes generated JavaScript run on BE as well as LE machines. (If 0, only327// LE systems are supported). Does not affect generated wasm.328// [experimental]329var SUPPORT_BIG_ENDIAN = false;330331// Check each write to the heap, for example, this will give a clear332// error on what would be segfaults in a native build (like dereferencing333// 0). See runtime_safe_heap.js for the actual checks performed.334// Set to value 1 to test for safe behavior for both Wasm+Wasm2JS builds.335// Set to value 2 to test for safe behavior for only Wasm builds. (notably,336// Wasm-only builds allow unaligned memory accesses. Note, however, that337// on some architectures unaligned accesses can be very slow, so it is still338// a good idea to verify your code with the more strict mode 1)339// [link]340var SAFE_HEAP = 0;341342// Log out all SAFE_HEAP operations343// [link]344var SAFE_HEAP_LOG = false;345346// Allows function pointers to be cast, wraps each call of an incorrect type347// with a runtime correction. This adds overhead and should not be used348// normally. Aside from making calls not fail, this tries to convert values as349// best it can. We use 64 bits (i64) to represent values, as if we wrote the350// sent value to memory and loaded the received type from the same memory (using351// truncs/extends/ reinterprets). This means that when types do not match the352// emulated values may not match (this is true of native too, for that matter -353// this is all undefined behavior). This approach appears good enough to354// support Python (the original motivation for this feature) and Glib (the355// continued motivation).356// [link]357var EMULATE_FUNCTION_POINTER_CASTS = false;358359// Print out exceptions in emscriptened code.360// [link]361var EXCEPTION_DEBUG = false;362363// Print out when we enter a library call (library*.js). You can also unset364// runtimeDebug at runtime for logging to cease, and can set it when you want365// it back. A simple way to set it in C++ is::366//367// emscripten_run_script("runtimeDebug = ...;");368//369// [link]370var LIBRARY_DEBUG = false;371372// Print out all musl syscalls, including translating their numeric index373// to the string name, which can be convenient for debugging. (Other system374// calls are not numbered and already have clear names; use :ref:`LIBRARY_DEBUG`375// to get logging for all of them.)376// [link]377var SYSCALL_DEBUG = false;378379// Log out socket/network data transfer.380// [link]381var SOCKET_DEBUG = false;382383// Log dynamic linker information384// [link]385var DYLINK_DEBUG = 0;386387// Register file system callbacks using trackingDelegate in library_fs.js388// [link]389var FS_DEBUG = false;390391// Select socket backend, either webrtc or websockets. XXX webrtc is not392// currently tested, may be broken393394// As well as being configurable at compile time via the "-s" option the395// WEBSOCKET_URL and WEBSOCKET_SUBPROTOCOL396// settings may be configured at run time via the Module object e.g.397// Module['websocket'] = {subprotocol: 'base64, binary, text'};398// Module['websocket'] = {url: 'wss://', subprotocol: 'base64'};399// You can set 'subprotocol' to null, if you don't want to specify it.400// Run time configuration may be useful as it lets an application select401// multiple different services.402// [link]403var SOCKET_WEBRTC = false;404405// A string containing either a WebSocket URL prefix (ws:// or wss://) or a406// complete RFC 6455 URL - "ws[s]:" "//" host [ ":" port ] path [ "?" query ].407// In the (default) case of only a prefix being specified the URL will be408// constructed from prefix + addr + ':' + port409// where addr and port are derived from the socket connect/bind/accept calls.410// [link]411var WEBSOCKET_URL = 'ws://';412413// If 1, the POSIX sockets API uses a native bridge process server to proxy414// sockets calls from browser to native world.415// [link]416var PROXY_POSIX_SOCKETS = false;417418// A string containing a comma separated list of WebSocket subprotocols419// as would be present in the Sec-WebSocket-Protocol header.420// You can set 'null', if you don't want to specify it.421// [link]422var WEBSOCKET_SUBPROTOCOL = 'binary';423424// Print out debugging information from our OpenAL implementation.425// [link]426var OPENAL_DEBUG = false;427428// If 1, prints out debugging related to calls from ``emscripten_web_socket_*``429// functions in ``emscripten/websocket.h``.430// If 2, additionally traces bytes communicated via the sockets.431// [link]432var WEBSOCKET_DEBUG = false;433434// Adds extra checks for error situations in the GL library. Can impact435// performance.436// [link]437var GL_ASSERTIONS = false;438439// If enabled, prints out all API calls to WebGL contexts. (*very* verbose)440// [link]441var TRACE_WEBGL_CALLS = false;442443// Enables more verbose debug printing of WebGL related operations. As with444// LIBRARY_DEBUG, this is toggleable at runtime with option GL.debug.445// [link]446var GL_DEBUG = false;447448// When enabled, sets preserveDrawingBuffer in the context, to allow tests to449// work (but adds overhead)450// [link]451var GL_TESTING = false;452453// How large GL emulation temp buffers are454// [link]455var GL_MAX_TEMP_BUFFER_SIZE = 2097152;456457// Enables some potentially-unsafe optimizations in GL emulation code458// [link]459var GL_UNSAFE_OPTS = true;460461// Forces support for all GLES2 features, not just the WebGL-friendly subset.462// [link]463var FULL_ES2 = false;464465// If true, glGetString() for GL_VERSION and GL_SHADING_LANGUAGE_VERSION will466// return strings OpenGL ES format "Open GL ES ... (WebGL ...)" rather than the467// WebGL format. If false, the direct WebGL format strings are returned. Set468// this to true to make GL contexts appear like an OpenGL ES context in these469// version strings (at the expense of a little bit of added code size), and to470// false to make GL contexts appear like WebGL contexts and to save some bytes471// from the output.472// [link]473var GL_EMULATE_GLES_VERSION_STRING_FORMAT = true;474475// If true, all GL extensions are advertised in unprefixed WebGL extension476// format, but also in desktop/mobile GLES/GL extension format with ``GL_``477// prefix.478// [link]479var GL_EXTENSIONS_IN_PREFIXED_FORMAT = true;480481// If true, adds support for automatically enabling all GL extensions for482// GLES/GL emulation purposes. This takes up code size. If you set this to 0,483// you will need to manually enable the extensions you need.484// [link]485var GL_SUPPORT_AUTOMATIC_ENABLE_EXTENSIONS = true;486487// If true, the function ``emscripten_webgl_enable_extension()`` can be called488// to enable any WebGL extension. If false, to save code size,489// ``emscripten_webgl_enable_extension()`` cannot be called to enable any of490// extensions 'ANGLE_instanced_arrays', 'OES_vertex_array_object',491// 'WEBGL_draw_buffers', 'WEBGL_multi_draw',492// 'WEBGL_draw_instanced_base_vertex_base_instance', or493// 'WEBGL_multi_draw_instanced_base_vertex_base_instance',494// but the dedicated functions ``emscripten_webgl_enable_*()``495// found in html5.h are used to enable each of those extensions.496// This way code size is increased only for the extensions that are actually used.497// N.B. if setting this to 0, GL_SUPPORT_AUTOMATIC_ENABLE_EXTENSIONS must be set498// to zero as well.499// [link]500var GL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS = true;501502// If set to 0, Emscripten GLES2->WebGL translation layer does not track the503// kind of GL errors that exist in GLES2 but do not exist in WebGL. Setting504// this to 0 saves code size. (Good to keep at 1 for development)505// [link]506var GL_TRACK_ERRORS = true;507508// If true, GL contexts support the explicitSwapControl context creation flag.509// Set to 0 to save a little bit of space on projects that do not need it.510// [link]511var GL_SUPPORT_EXPLICIT_SWAP_CONTROL = false;512513// If true, calls to glUniform*fv and glUniformMatrix*fv utilize a pool of514// preallocated temporary buffers for common small sizes to avoid generating515// temporary garbage for WebGL 1. Disable this to optimize generated size of the516// GL library a little bit, at the expense of generating garbage in WebGL 1. If517// you are only using WebGL 2 and do not support WebGL 1, this is not needed and518// you can turn it off.519// [link]520var GL_POOL_TEMP_BUFFERS = true;521522// If true, enables support for the EMSCRIPTEN_explicit_uniform_location WebGL523// extension. See docs/EMSCRIPTEN_explicit_uniform_location.txt524var GL_EXPLICIT_UNIFORM_LOCATION = false;525526// If true, enables support for the EMSCRIPTEN_uniform_layout_binding WebGL527// extension. See docs/EMSCRIPTEN_explicit_uniform_binding.txt528var GL_EXPLICIT_UNIFORM_BINDING = false;529530// Deprecated. Pass -sMAX_WEBGL_VERSION=2 to target WebGL 2.0.531// [link]532var USE_WEBGL2 = false;533534// Specifies the lowest WebGL version to target. Pass -sMIN_WEBGL_VERSION=1535// to enable targeting WebGL 1, and -sMIN_WEBGL_VERSION=2 to drop support536// for WebGL 1.0537// [link]538var MIN_WEBGL_VERSION = 1;539540// Specifies the highest WebGL version to target. Pass -sMAX_WEBGL_VERSION=2541// to enable targeting WebGL 2. If WebGL 2 is enabled, some APIs (EGL, GLUT, SDL)542// will default to creating a WebGL 2 context if no version is specified.543// Note that there is no automatic fallback to WebGL1 if WebGL2 is not supported544// by the user's device, even if you build with both WebGL1 and WebGL2545// support, as that may not always be what the application wants. If you want546// such a fallback, you can try to create a context with WebGL2, and if that547// fails try to create one with WebGL1.548// [link]549var MAX_WEBGL_VERSION = 1;550551// If true, emulates some WebGL 1 features on WebGL 2 contexts, meaning that552// applications that use WebGL 1/GLES 2 can initialize a WebGL 2/GLES3 context,553// but still keep using WebGL1/GLES 2 functionality that no longer is supported554// in WebGL2/GLES3. Currently this emulates GL_EXT_shader_texture_lod extension555// in GLSL ES 1.00 shaders, support for unsized internal texture formats, and the556// GL_HALF_FLOAT_OES != GL_HALF_FLOAT mixup.557// [link]558var WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION = false;559560// Forces support for all GLES3 features, not just the WebGL2-friendly subset.561// This automatically turns on FULL_ES2 and WebGL2 support.562// [link]563var FULL_ES3 = false;564565// Includes code to emulate various desktop GL features. Incomplete but useful566// in some cases, see567// http://kripken.github.io/emscripten-site/docs/porting/multimedia_and_graphics/OpenGL-support.html568// [link]569var LEGACY_GL_EMULATION = false;570571// If you specified LEGACY_GL_EMULATION = 1 and only use fixed function pipeline572// in your code, you can also set this to 1 to signal the GL emulation layer573// that it can perform extra optimizations by knowing that the user code does574// not use shaders at all. If LEGACY_GL_EMULATION = 0, this setting has no575// effect.576// [link]577var GL_FFP_ONLY = false;578579// If you want to create the WebGL context up front in JS code, set this to 1580// and set Module['preinitializedWebGLContext'] to a precreated WebGL context.581// WebGL initialization afterwards will use this GL context to render.582// [link]583var GL_PREINITIALIZED_CONTEXT = false;584585// Enables building of stb-image, a tiny public-domain library for decoding586// images, allowing decoding of images without using the browser's built-in587// decoders. The benefit is that this can be done synchronously, however, it588// will not be as fast as the browser itself. When enabled, stb-image will be589// used automatically from IMG_Load and IMG_Load_RW. You can also call the590// ``stbi_*`` functions directly yourself.591// [link]592var STB_IMAGE = false;593594// From Safari 8 (where WebGL was introduced to Safari) onwards, OES_texture_half_float and OES_texture_half_float_linear extensions595// are broken and do not function correctly, when used as source textures.596// See https://webkit.org/b/183321, https://webkit.org/b/169999,597// https://stackoverflow.com/questions/54248633/cannot-create-half-float-oes-texture-from-uint16array-on-ipad598// [link]599var GL_DISABLE_HALF_FLOAT_EXTENSION_IF_BROKEN = false;600601// Workaround Safari WebGL issue: After successfully acquiring WebGL context on a canvas,602// calling .getContext() will always return that context independent of which 'webgl' or 'webgl2'603// context version was passed. See https://webkit.org/b/222758 and604// https://github.com/emscripten-core/emscripten/issues/13295.605// Set this to 0 to force-disable the workaround if you know the issue will not affect you.606// [link]607var GL_WORKAROUND_SAFARI_GETCONTEXT_BUG = true;608609// If 1, link with support to glGetProcAddress() functionality.610// In WebGL, glGetProcAddress() causes a substantial code size and performance impact, since WebGL611// does not natively provide such functionality, and it must be emulated. Using glGetProcAddress()612// is not recommended. If you still need to use this, e.g. when porting an existing renderer,613// you can link with -sGL_ENABLE_GET_PROC_ADDRESS to get support for this functionality.614// [link]615var GL_ENABLE_GET_PROC_ADDRESS = true;616617// Use JavaScript math functions like Math.tan. This saves code size as we can avoid shipping618// compiled musl code. However, it can be significantly slower as it calls out to JS. It619// also may give different results as JS math is specced somewhat differently than libc, and620// can also vary between browsers.621// [link]622var JS_MATH = false;623624// If set, enables polyfilling for Math.clz32, Math.trunc, Math.imul, Math.fround.625// [link]626var POLYFILL_OLD_MATH_FUNCTIONS = false;627628// Set this to enable compatibility emulations for old JavaScript engines. This gives you629// the highest possible probability of the code working everywhere, even in rare old630// browsers and shell environments. Specifically:631//632// - Add polyfilling for Math.clz32, Math.trunc, Math.imul, Math.fround. (-sPOLYFILL_OLD_MATH_FUNCTIONS)633// - Disable WebAssembly. (Must be paired with -sWASM=0)634// - Adjusts MIN_X_VERSION settings to 0 to include support for all browser versions.635// - Avoid TypedArray.fill, if necessary, in zeroMemory utility function.636//637// You can also configure the above options individually.638// [link]639var LEGACY_VM_SUPPORT = false;640641// Specify which runtime environments the JS output will be capable of running642// in. For maximum portability this can be configured to support all643// environments or it can be limited to reduce overall code size. The supported644// environments are:645//646// - 'web' - the normal web environment.647// - 'webview' - just like web, but in a webview like Cordova; considered to be648// same as "web" in almost every place649// - 'worker' - a web worker environment.650// - 'worklet' - Audio Worklet environment.651// - 'node' - Node.js.652// - 'shell' - a JS shell like d8, js, or jsc.653//654// This setting can be a comma-separated list of these environments, e.g.,655// "web,worker". If this is the empty string, then all environments are656// supported.657//658// Certain settings will automatically add to this list. For examble, building659// with pthreads will automatically add `worker` and building with660// ``AUDIO_WORKLET`` will automatically add `worklet`.661//662// Note that the set of environments recognized here is not identical to the663// ones we identify at runtime using ``ENVIRONMENT_IS_*``. Specifically:664//665// - We detect whether we are a pthread at runtime, but that's set for workers666// and not for the main file so it wouldn't make sense to specify here.667// - The webview target is basically a subset of web. It must be specified668// alongside web (e.g. "web,webview") and we only use it for code generation669// at compile time, there is no runtime behavior change.670//671// Note that by default we do not include the 'shell' environment since direct672// usage of d8, spidermonkey and jsc is extremely rare.673// [link]674var ENVIRONMENT = ['web', 'webview', 'worker', 'node'];675676// Enable this to support lz4-compressed file packages. They are stored compressed in memory, and677// decompressed on the fly, avoiding storing the entire decompressed data in memory at once.678// If you run the file packager separately, you still need to build the main program with this flag,679// and also pass --lz4 to the file packager.680// (You can also manually compress one on the client, using LZ4.loadPackage(), but that is less681// recommended.)682// Limitations:683//684// - LZ4-compressed files are only decompressed when needed, so they are not available685// for special preloading operations like pre-decoding of images using browser codecs,686// preloadPlugin stuff, etc.687// - LZ4 files are read-only.688//689// [link]690var LZ4 = false;691692// Emscripten (JavaScript-based) exception handling options.693// The three related settings (:ref:`DISABLE_EXCEPTION_CATCHING`,694// :ref:`EXCEPTION_CATCHING_ALLOWED`, and :ref:`DISABLE_EXCEPTION_THROWING`)695// only pertain to JavaScript-based exception handling and do not control the696// native Wasm exception handling option (``-fwasm-exceptions``)697698// Disables generating code to actually catch exceptions. This disabling is on699// by default as the overhead of exceptions is quite high in size and speed700// currently (in the future, wasm should improve that). When exceptions are701// disabled, if an exception actually happens then it will not be caught702// and the program will halt (so this will not introduce silent failures).703//704// .. note::705//706// This removes *catching* of exceptions, which is the main707// issue for speed, but you should build source files with708// -fno-exceptions to really get rid of all exceptions code overhead,709// as it may contain thrown exceptions that are never caught (e.g.710// just using std::vector can have that). -fno-rtti may help as well.711//712// This option is mutually exclusive with :ref:`EXCEPTION_CATCHING_ALLOWED`.713//714// This option only applies to Emscripten (JavaScript-based) exception handling715// and does not control the native Wasm exception handling.716//717// [compile+link]718var DISABLE_EXCEPTION_CATCHING = 1;719720// Enables catching exception but only in the listed functions. This721// option acts like a more precise version of ``DISABLE_EXCEPTION_CATCHING=0``.722//723// This option is mutually exclusive with :ref:`DISABLE_EXCEPTION_CATCHING`.724//725// This option only applies to Emscripten (JavaScript-based) exception handling726// and does not control the native Wasm exception handling.727//728// [compile+link]729var EXCEPTION_CATCHING_ALLOWED = [];730731// Internal: Tracks whether Emscripten should link in exception throwing (C++732// 'throw') support library. This does not need to be set directly, but pass733// -fno-exceptions to the build disable exceptions support. (This is basically734// -fno-exceptions, but checked at final link time instead of individual .cpp735// file compile time) If the program *does* contain throwing code (some source736// files were not compiled with ``-fno-exceptions``), and this flag is set at link737// time, then you will get errors on undefined symbols, as the exception738// throwing code is not linked in. If so you should either unset the option (if739// you do want exceptions) or fix the compilation of the source files so that740// indeed no exceptions are used).741//742// This option only applies to Emscripten (JavaScript-based) exception handling743// and does not control the native Wasm exception handling.744//745// [compile+link]746var DISABLE_EXCEPTION_THROWING = false;747748// Make the exception message printing function, 'getExceptionMessage' available749// in the JS library for use, by adding necessary symbols to750// :ref:`EXPORTED_FUNCTIONS`.751//752// This works with both Emscripten EH and Wasm EH. When you catch an exception753// from JS, that gives you a user-thrown value in case of Emscripten EH, and a754// WebAssembly.Exception object in case of Wasm EH. 'getExceptionMessage' takes755// the user-thrown value in case of Emscripten EH and the WebAssembly.Exception756// object in case of Wasm EH, meaning in both cases you can pass a caught757// exception directly to the function.758//759// When used with Wasm EH, this option additionally provides these functions in760// the JS library:761//762// - getCppExceptionTag: Returns the C++ tag763// - getCppExceptionThrownObjectFromWebAssemblyException:764// Given an WebAssembly.Exception object, returns the actual user-thrown C++765// object address in Wasm memory.766//767// Setting this option also adds refcount incrementing and decrementing768// functions ('incrementExceptionRefcount' and 'decrementExceptionRefcount') in769// the JS library because if you catch an exception from JS, you may need to770// manipulate the refcount manually to avoid memory leaks.771//772// See test_EXPORT_EXCEPTION_HANDLING_HELPERS in test/test_core.py for an773// example usage.774var EXPORT_EXCEPTION_HANDLING_HELPERS = false;775776// When this is enabled, exceptions will contain stack traces and uncaught777// exceptions will display stack traces upon exiting. This defaults to true when778// ASSERTIONS is enabled. This option is for users who want exceptions' stack779// traces but do not want other overheads ASSERTIONS can incur.780// This option implies :ref:`EXPORT_EXCEPTION_HANDLING_HELPERS`.781// [link]782var EXCEPTION_STACK_TRACES = false;783784// If true, emit instructions for the legacy Wasm exception handling proposal:785// https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/legacy/Exceptions.md786// If false, emit instructions for the standardized exception handling proposal:787// https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md788// [compile+link]789var WASM_LEGACY_EXCEPTIONS = true;790791// Emscripten throws an ExitStatus exception to unwind when exit() is called.792// Without this setting enabled this can show up as a top level unhandled793// exception.794//795// With this setting enabled a global uncaughtException handler is used to796// catch and handle ExitStatus exceptions. However, this means all other797// uncaught exceptions are also caught and re-thrown, which is not always798// desirable.799//800// [link]801var NODEJS_CATCH_EXIT = false;802803// Catch unhandled rejections in node. This only affects versions of node older804// than 15. Without this, old version node will print a warning, but exit805// with a zero return code. With this setting enabled, we handle any unhandled806// rejection and throw an exception, which will cause the process to exit807// immediately with a non-0 return code.808// This is not needed in Node 15+ so this setting will default to false if809// MIN_NODE_VERSION is 150000 or above.810// [link]811var NODEJS_CATCH_REJECTION = true;812813// Whether to support async operations in the compiled code. This makes it814// possible to call JS functions from synchronous-looking code in C/C++.815//816// - 1 (default): Run binaryen's Asyncify pass to transform the code using817// asyncify. This emits a normal wasm file in the end, so it works everywhere,818// but it has a significant cost in terms of code size and speed.819// See https://emscripten.org/docs/porting/asyncify.html820// - 2 (deprecated): Use ``-sJSPI`` instead.821//822// [link]823var ASYNCIFY = 0;824825// Imports which can do an async operation, in addition to the default ones that826// emscripten defines like emscripten_sleep. If you add more you will need to827// mention them to here, or else they will not work (in :ref:`ASSERTIONS` builds828// an error will be shown).829// Note that this list used to contain the default ones, which meant that you830// had to list them when adding your own; the default ones are now added831// automatically.832// [link]833var ASYNCIFY_IMPORTS = [];834835// Whether indirect calls can be on the stack during an unwind/rewind.836// If you know they cannot, then setting this can be extremely helpful, as837// otherwise asyncify must assume an indirect call can reach almost everywhere.838// [link]839var ASYNCIFY_IGNORE_INDIRECT = false;840841// The size of the asyncify stack - the region used to store unwind/rewind842// info. This must be large enough to store the call stack and locals. If it is843// too small, you will see a wasm trap due to executing an "unreachable"844// instruction. In that case, you should increase this size.845// [link]846var ASYNCIFY_STACK_SIZE = 4096;847848// If the Asyncify remove-list is provided, then the functions in it will not849// be instrumented even if it looks like they need to. This can be useful850// if you know things the whole-program analysis doesn't, like if you851// know certain indirect calls are safe and won't unwind. But if you852// get the list wrong things will break (and in a production build user853// input might reach code paths you missed during testing, so it's hard854// to know you got this right), so this is not recommended unless you855// really know what are doing, and need to optimize every bit of speed856// and size.857//858// The names in this list are names from the WebAssembly Names section. The859// wasm backend will emit those names in *human-readable* form instead of860// typical C++ mangling. For example, you should write ``Struct::func()``861// instead of ``_ZN6Struct4FuncEv``. C is also different from C++, as C862// names don't end with parameters; as a result foo(int) in C++ would appear863// as just foo in C (C++ has parameters because it needs to differentiate864// overloaded functions). You will see warnings in the console if a name in the865// list is missing (these are not errors because inlining etc. may cause866// changes which would mean a single list couldn't work for both -O0 and -O1867// builds, etc.). You can inspect the wasm binary to look for the actual names,868// either directly or using wasm-objdump or wasm-dis, etc.869//870// Simple ``*`` wildcard matching is supported.871//872// To avoid dealing with limitations in operating system shells or build system873// escaping, the following substitutions can be made:874//875// - ' ' -> ``.``,876// - ``&`` -> ``#``,877// - ``,`` -> ``?``.878//879// That is, the function `"foo(char const*, int&)"` can be inputted as880// `"foo(char.const*?.int#)"` on the command line instead.881//882// Note: Whitespace is part of the function signature! I.e.883// "foo(char const *, int &)" will not match "foo(char const*, int&)", and884// neither would "foo(const char*, int &)".885//886// [link]887var ASYNCIFY_REMOVE = [];888889// Functions in the Asyncify add-list are added to the list of instrumented890// functions, that is, they will be instrumented even if otherwise asyncify891// thinks they don't need to be. As by default everything will be instrumented892// in the safest way possible, this is only useful if you use IGNORE_INDIRECT893// and use this list to fix up some indirect calls that *do* need to be894// instrumented.895//896// See :ref:`ASYNCIFY_REMOVE` about the names, including wildcard matching and897// character substitutions.898// [link]899var ASYNCIFY_ADD = [];900901// If enabled, instrumentation status will be propagated from the add-list, ie.902// their callers, and their callers' callers, and so on. If disabled then all903// callers must be manually added to the add-list (like the only-list).904// [link]905var ASYNCIFY_PROPAGATE_ADD = true;906907// If the Asyncify only-list is provided, then *only* the functions in the list908// will be instrumented. Like the remove-list, getting this wrong will break909// your application.910//911// See :ref:`ASYNCIFY_REMOVE` about the names, including wildcard matching and912// character substitutions.913// [link]914var ASYNCIFY_ONLY = [];915916// If enabled will output which functions have been instrumented and why.917// [link]918var ASYNCIFY_ADVISE = false;919920// Runtime debug logging from asyncify internals.921//922// - 1: Minimal logging.923// - 2: Verbose logging.924//925// [link]926var ASYNCIFY_DEBUG = 0;927928// Deprecated, use JSPI_EXPORTS instead.929// [deprecated]930var ASYNCIFY_EXPORTS = [];931932// Use VM support for the JavaScript Promise Integration proposal. This allows933// async operations to happen without the overhead of modifying the wasm. This934// is experimental at the moment while spec discussion is ongoing, see935// https://github.com/WebAssembly/js-promise-integration/ TODO: document which936// of the following flags are still relevant in this mode (e.g. IGNORE_INDIRECT937// etc. are not needed)938//939// [link]940var JSPI = 0;941942// A list of exported module functions that will be asynchronous. Each export943// will return a ``Promise`` that will be resolved with the result. Any exports944// that will call an asynchronous import (listed in ``JSPI_IMPORTS``) must be945// included here.946//947// By default this includes ``main``.948// [link]949var JSPI_EXPORTS = [];950951952// A list of imported module functions that will potentially do asynchronous953// work. The imported function should return a ``Promise`` when doing954// asynchronous work.955//956// Note when using JS library files, the function can be marked with957// ``<function_name>_async:: true`` in the library instead of this setting.958// [link]959var JSPI_IMPORTS = [];960961// Runtime elements that are exported on Module by default. We used to export962// quite a lot here, but have removed them all. You should use963// EXPORTED_RUNTIME_METHODS for things you want to export from the runtime.964// Note that the name may be slightly misleading, as this is for any JS library965// element, and not just methods. For example, we can export the FS object by966// having "FS" in this list.967// [link]968var EXPORTED_RUNTIME_METHODS = [];969970// A list of incoming values on the Module object in JS that we care about. If971// a value is not in this list, then we don't emit code to check if you provide972// it on the Module object. For example, if973// you have this::974//975// var Module = {976// print: (x) => console.log('print: ' + x),977// preRun: [() => console.log('pre run')]978// };979//980// Then INCOMING_MODULE_JS_API must contain 'print' and 'preRun'; if it does not981// then we may not emit code to read and use that value. In other words, this982// option lets you set, statically at compile time, the list of which Module983// JS values you will be providing at runtime, so the compiler can better984// optimize.985//986// Setting this list to [], or at least a short and concise set of names you987// actually use, can be very useful for reducing code size. By default, the988// list contains a set of commonly used symbols.989//990// FIXME: should this just be 0 if we want everything?991// [link]992var INCOMING_MODULE_JS_API = [993'ENVIRONMENT', 'GL_MAX_TEXTURE_IMAGE_UNITS', 'SDL_canPlayWithWebAudio',994'SDL_numSimultaneouslyQueuedBuffers', 'INITIAL_MEMORY', 'wasmMemory', 'arguments',995'buffer', 'canvas', 'doNotCaptureKeyboard', 'dynamicLibraries',996'elementPointerLock', 'extraStackTrace', 'forcedAspectRatio',997'instantiateWasm', 'keyboardListeningElement', 'freePreloadedMediaOnUse',998'locateFile', 'mainScriptUrlOrBlob', 'mem',999'monitorRunDependencies', 'noExitRuntime', 'noInitialRun', 'onAbort',1000'onExit', 'onFree', 'onFullScreen', 'onMalloc',1001'onRealloc', 'onRuntimeInitialized', 'postMainLoop', 'postRun', 'preInit',1002'preMainLoop', 'preRun',1003'preinitializedWebGLContext', 'preloadPlugins',1004'print', 'printErr', 'setStatus', 'statusMessage', 'stderr',1005'stdin', 'stdout', 'thisProgram', 'wasm', 'wasmBinary', 'websocket'1006];10071008// If set to nonzero, the provided virtual filesystem is treated1009// case-insensitive, like Windows and macOS do. If set to 0, the VFS is1010// case-sensitive, like on Linux.1011// [link]1012var CASE_INSENSITIVE_FS = false;10131014// If set to 0, does not build in any filesystem support. Useful if you are just1015// doing pure computation, but not reading files or using any streams (including1016// fprintf, and other stdio.h things) or anything related. The one exception is1017// there is partial support for printf, and puts, hackishly. The compiler will1018// automatically set this if it detects that syscall usage (which is static)1019// does not require a full filesystem. If you still want filesystem support, use1020// FORCE_FILESYSTEM1021// [link]1022var FILESYSTEM = true;10231024// Makes full filesystem support be included, even if statically it looks like1025// it is not used. For example, if your C code uses no files, but you include1026// some JS that does, you might need this.1027// [link]1028var FORCE_FILESYSTEM = false;10291030// Enables support for the ``NODERAWFS`` filesystem backend. This is a special1031// backend as it replaces all normal filesystem access with direct Node.js1032// operations, without the need to do ``FS.mount()``, and this backend only1033// works with Node.js. The initial working directory will be same as1034// process.cwd() instead of VFS root directory. Because this mode directly uses1035// Node.js to access the real local filesystem on your OS, the code will not1036// necessarily be portable between OSes - it will be as portable as a Node.js1037// program would be, which means that differences in how the underlying OS1038// handles permissions and errors and so forth may be noticeable.1039//1040// Enabling this setting will also enable :ref:`NODE_HOST_ENV` by default.1041// [link]1042var NODERAWFS = false;10431044// When running under Node, expose the underlying OS environment variables.1045// This is similar to how ``NODERAWFS`` exposes the underlying FS.1046// This setting gets enabled by default when ``NODERAWFS`` is enabled, but can1047// also be controlled separately.1048var NODE_HOST_ENV = false;10491050// This saves the compiled wasm module in a file with name1051// ``$WASM_BINARY_NAME.$V8_VERSION.cached``1052// and loads it on subsequent runs. This caches the compiled wasm code from1053// v8 in node, which saves compiling on subsequent runs, making them start up1054// much faster.1055// The V8 version used in node is included in the cache name so that we don't1056// try to load cached code from another version, which fails silently (it seems1057// to load ok, but we do actually recompile).1058//1059// - The only version known to work for sure is node 12.9.1, as this has1060// regressed, see1061// https://github.com/nodejs/node/issues/18265#issuecomment-6229715471062// - The default location of the .cached files is alongside the wasm binary,1063// as mentioned earlier. If that is in a read-only directory, you may need1064// to place them elsewhere. You can use the locateFile() hook to do so.1065//1066// [link]1067var NODE_CODE_CACHING = false;10681069// Symbols that are explicitly exported. These symbols are kept alive through1070// LLVM dead code elimination, and also made accessible outside of the1071// generated code even after running closure compiler (on "Module"). Native1072// symbols listed here require an ``_`` prefix.1073//1074// By default if this setting is not specified on the command line the1075// ``_main`` function will be implicitly exported. In :ref:`STANDALONE_WASM`1076// mode the default export is ``__start`` (or ``__initialize`` if ``--no-entry``1077// is specified).1078//1079// JS Library symbols can also be added to this list (without the leading `$`).1080// [link]1081var EXPORTED_FUNCTIONS = [];10821083// If true, we export all the symbols that are present in JS onto the Module1084// object. This does not affect which symbols will be present - it does not1085// prevent DCE or cause anything to be included in linking. It only does1086// ``Module['X'] = X;``1087// for all X that end up in the JS file. This is useful to export the JS1088// library functions on Module, for things like dynamic linking.1089// [link]1090var EXPORT_ALL = false;10911092// If true, we export the symbols that are present in JS onto the Module1093// object.1094// It only does ``Module['X'] = X;``1095var EXPORT_KEEPALIVE = true;10961097// Remembers the values of these settings, and makes them accessible1098// through getCompilerSetting and emscripten_get_compiler_setting.1099// To see what is retained, look for compilerSettings in the generated code.1100// [link]1101var RETAIN_COMPILER_SETTINGS = false;11021103// JS library elements (C functions implemented in JS) that we include by1104// default. If you want to make sure something is included by the JS compiler,1105// add it here. For example, if you do not use some ``emscripten_*`` C API call1106// from C, but you want to call it from JS, add it here.1107// Note that the name may be slightly misleading, as this is for any JS1108// library element, and not just functions. For example, you can include the1109// Browser object by adding "$Browser" to this list.1110//1111// If you want to both include and export a JS library symbol, it is enough to1112// simply add it to EXPORTED_FUNCTIONS, without also adding it to1113// DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.1114// [link]1115var DEFAULT_LIBRARY_FUNCS_TO_INCLUDE = [];11161117// Include all JS library functions instead of the sum of1118// DEFAULT_LIBRARY_FUNCS_TO_INCLUDE + any functions used by the generated code.1119// This is needed when dynamically loading (i.e. dlopen) modules that make use1120// of runtime library functions that are not used in the main module. Note that1121// this only applies to js libraries, *not* C. You will need the main file to1122// include all needed C libraries. For example, if a module uses malloc or new,1123// you will need to use those in the main file too to pull in malloc for use by1124// the module.1125// [link]1126var INCLUDE_FULL_LIBRARY = false;11271128// If set to 1, we emit relocatable code from the LLVM backend; both1129// globals and function pointers are all offset (by gb and fp, respectively)1130// Automatically set for SIDE_MODULE or MAIN_MODULE.1131// [compile+link]1132// [deprecated]1133var RELOCATABLE = false;11341135// A main module is a file compiled in a way that allows us to link it to1136// a side module at runtime.1137//1138// - 1: Normal main module.1139// - 2: DCE'd main module. We eliminate dead code normally. If a side1140// module needs something from main, it is up to you to make sure1141// it is kept alive.1142//1143// [compile+link]1144var MAIN_MODULE = 0;11451146// Corresponds to MAIN_MODULE (also supports modes 1 and 2)1147// [compile+link]1148var SIDE_MODULE = 0;11491150// Deprecated, list shared libraries directly on the command line instead.1151// [link]1152// [deprecated]1153var RUNTIME_LINKED_LIBS = [];11541155// If set to 1, this is a worker library, a special kind of library that is run1156// in a worker. See emscripten.h1157// [link]1158var BUILD_AS_WORKER = false;11591160// If set to 1, compiles in a small stub main() in between the real main() which1161// calls pthread_create() to run the application main() in a pthread. This is1162// something that applications can do manually as well if they wish, this option1163// is provided as convenience.1164//1165// The pthread that main() runs on is a normal pthread in all ways, with the one1166// difference that its stack size is the same as the main thread would normally1167// have, that is, STACK_SIZE. This makes it easy to flip between1168// PROXY_TO_PTHREAD and non-PROXY_TO_PTHREAD modes with main() always getting1169// the same amount of stack.1170//1171// This proxies Module['canvas'], if present, and if OFFSCREENCANVAS_SUPPORT1172// is enabled. This has to happen because this is the only chance - this browser1173// main thread does the only pthread_create call that happens on1174// that thread, so it's the only chance to transfer the canvas from there.1175// [link]1176var PROXY_TO_PTHREAD = false;11771178// If set to 1, this file can be linked with others, either as a shared library1179// or as the main file that calls a shared library. To enable that, we will not1180// internalize all symbols and cull the unused ones, in other words, we will not1181// remove unused functions and globals, which might be used by another module we1182// are linked with.1183//1184// MAIN_MODULE and SIDE_MODULE both imply this, so it not normally necessary1185// to set this explicitly. Note that MAIN_MODULE and SIDE_MODULE mode 2 do1186// *not* set this, so that we still do normal DCE on them, and in that case1187// you must keep relevant things alive yourself using exporting.1188// [compile+link]1189// [deprecated]1190var LINKABLE = false;11911192// Emscripten 'strict' build mode: Drop supporting any deprecated build options.1193// Set the environment variable EMCC_STRICT=1 or pass -sSTRICT to test that a1194// codebase builds nicely in forward compatible manner.1195// Changes enabled by this:1196//1197// - The C define EMSCRIPTEN is not defined (__EMSCRIPTEN__ always is, and1198// is the correct thing to use).1199// - STRICT_JS is enabled.1200// - IGNORE_MISSING_MAIN is disabled.1201// - AUTO_JS_LIBRARIES is disabled.1202// - AUTO_NATIVE_LIBRARIES is disabled.1203// - DEFAULT_TO_CXX is disabled.1204// - USE_GLFW is set to 0 rather than 2 by default.1205// - ALLOW_UNIMPLEMENTED_SYSCALLS is disabled.1206// - INCOMING_MODULE_JS_API is set to empty by default.1207// [compile+link]1208var STRICT = false;12091210// Allow program to link with or without ``main`` symbol.1211// If this is disabled then one must provide a ``main`` symbol or explicitly1212// opt out by passing ``--no-entry`` or an EXPORTED_FUNCTIONS list that doesn't1213// include ``_main``.1214// [link]1215var IGNORE_MISSING_MAIN = true;12161217// Add ``"use strict;"`` to generated JS1218// [link]1219var STRICT_JS = false;12201221// If set to 1, we will warn on any undefined symbols that are not resolved by1222// the ``library_*.js`` files. Note that it is common in large projects to not1223// implement everything, when you know what is not going to actually be called1224// (and don't want to mess with the existing buildsystem), and functions might1225// be implemented later on, say in --pre-js, so you may want to build with -s1226// WARN_ON_UNDEFINED_SYMBOLS=0 to disable the warnings if they annoy you. See1227// also ERROR_ON_UNDEFINED_SYMBOLS. Any undefined symbols that are listed in1228// EXPORTED_FUNCTIONS will also be reported.1229// [link]1230var WARN_ON_UNDEFINED_SYMBOLS = true;12311232// If set to 1, we will give a link-time error on any undefined symbols (see1233// WARN_ON_UNDEFINED_SYMBOLS). To allow undefined symbols at link time set this1234// to 0, in which case if an undefined function is called a runtime error will1235// occur. Any undefined symbols that are listed in EXPORTED_FUNCTIONS will also1236// be reported.1237// [link]1238var ERROR_ON_UNDEFINED_SYMBOLS = true;12391240// Use small chunk size for binary synchronous XHR's in Web Workers. Used for1241// testing. See test_chunked_synchronous_xhr in runner.py and library.js.1242// [link]1243var SMALL_XHR_CHUNKS = false;12441245// If 1, we force Date.now(), Math.random, etc. to return deterministic results.1246// This also tries to make execution deterministic across machines and1247// environments, for example, not doing anything different based on the1248// browser's language setting (which would mean you can get different results1249// in different browsers, or in the browser and in node).1250// Good for comparing builds for debugging purposes (and nothing else).1251// [link]1252var DETERMINISTIC = false;12531254// By default we emit all code in a straightforward way into the output1255// .js file. That means that if you load that in a script tag in a web1256// page, it will use the global scope. With ``MODULARIZE`` set, we instead emit1257// the code wrapped in an async function. This function returns a promise that1258// resolves to a module instance once it is safe to run the compiled code1259// (similar to the ``onRuntimeInitialized`` callback).1260//1261// The default name of the function is ``Module``, but can be changed using the1262// ``EXPORT_NAME`` option. We recommend renaming it to a more typical name for a1263// factory function, e.g. ``createModule``.1264//1265// You use the factory function like so::1266//1267// const module = await EXPORT_NAME();1268//1269// or::1270//1271// let module;1272// EXPORT_NAME().then(instance => {1273// module = instance;1274// });1275//1276//1277// The factory function accepts 1 parameter, an object with default values for1278// the module instance::1279//1280// const module = await EXPORT_NAME({ option: value, ... });1281//1282// Note the parentheses - we are calling EXPORT_NAME in order to instantiate1283// the module. This allows you to create multiple instances of the module.1284//1285// Note that in MODULARIZE mode we do *not* look for a global ``Module`` object1286// for default values. Default values must be passed as a parameter to the1287// factory function.1288//1289// The default .html shell file provided in MINIMAL_RUNTIME mode will create1290// a singleton instance automatically, to run the application on the page.1291// (Note that it does so without using the Promise API mentioned earlier, and1292// so code for the Promise is not even emitted in the .js file if you tell1293// emcc to emit an .html output.)1294// The default .html shell file provided by traditional runtime mode is only1295// compatible with MODULARIZE=0 mode, so when building with traditional1296// runtime, you should provided your own html shell file to perform the1297// instantiation when building with MODULARIZE=1. (For more details, see1298// https://github.com/emscripten-core/emscripten/issues/7950)1299//1300// If you add --pre-js or --post-js files, they will be included inside1301// the factory function with the rest of the emitted code in order to be1302// optimized together with it.1303//1304// If you want to include code outside all of the generated code, including the1305// factory function, you can use --extern-pre-js or --extern-post-js. While1306// --pre-js and --post-js happen to do that in non-MODULARIZE mode, their1307// intended usage is to add code that is optimized with the rest of the emitted1308// code, allowing better dead code elimination and minification.1309//1310// Experimental Feature - Instance ES Modules:1311//1312// Note this feature is still under active development and is subject to change!1313//1314// To enable this feature use -sMODULARIZE=instance. Enabling this mode will1315// produce an ES module that is a singleton with ES module exports. The1316// module will export a default value that is an async init function and will1317// also export named values that correspond to the Wasm exports and runtime1318// exports. The init function must be called before any of the exports can be1319// used. An example of using the module is below.1320//1321// import init, { foo, bar } from "./my_module.mjs"1322// await init(optionalArguments);1323// foo();1324// bar();1325//1326// [link]1327var MODULARIZE = false;13281329// Export using an ES6 Module export rather than a UMD export. MODULARIZE must1330// be enabled for ES6 exports and is implicitly enabled if not already set.1331//1332// This is implicitly enabled if the output suffix is set to 'mjs'.1333//1334// [link]1335var EXPORT_ES6 = false;13361337// Global variable to export the module as for environments without a1338// standardized module loading system (e.g. the browser and SM shell).1339// [link]1340var EXPORT_NAME = 'Module';13411342// When set to 0, we do not emit eval() and new Function(), which disables some1343// functionality (causing runtime errors if attempted to be used), but allows1344// the emitted code to be acceptable in places that disallow dynamic code1345// execution (chrome packaged app, privileged firefox app, etc.). Pass this flag1346// when developing an Emscripten application that is targeting a privileged or a1347// certified execution environment, see Firefox Content Security Policy (CSP)1348// webpage for details:1349// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src1350// in particular the 'unsafe-eval' and 'wasm-unsafe-eval' policies.1351//1352// When this flag is set, the following features (linker flags) are unavailable:1353//1354// - RELOCATABLE: the function loadDynamicLibrary would need to eval().1355//1356// and some features may fall back to slower code paths when they need to:1357// Embind: uses eval() to jit functions for speed.1358//1359// Additionally, the following Emscripten runtime functions are unavailable when1360// DYNAMIC_EXECUTION=0 is set, and an attempt to call them will throw an exception:1361//1362// - emscripten_run_script(),1363// - emscripten_run_script_int(),1364// - emscripten_run_script_string(),1365// - dlopen(),1366// - the functions ccall() and cwrap() are still available, but they are1367// restricted to only being able to call functions that have been exported in1368// the Module object in advance.1369//1370// When -sDYNAMIC_EXECUTION=2 is set, attempts to call to eval() are demoted to1371// warnings instead of throwing an exception.1372// [link]1373var DYNAMIC_EXECUTION = 1;13741375// whether we are in the generate struct_info bootstrap phase1376// [link]1377var BOOTSTRAPPING_STRUCT_INFO = false;13781379// Add some calls to emscripten tracing APIs1380// [compile+link]1381var EMSCRIPTEN_TRACING = false;13821383// Specify the GLFW version that is being linked against. Only relevant, if you1384// are linking against the GLFW library. Valid options are 2 for GLFW2 and 31385// for GLFW3.1386// [link]1387var USE_GLFW = 0;13881389// Whether to use compile code to WebAssembly. Set this to 0 to compile to JS1390// instead of wasm.1391//1392// Specify -sWASM=2 to target both WebAssembly and JavaScript at the same time.1393// In that build mode, two files a.wasm and a.wasm.js are produced, and at runtime1394// the WebAssembly file is loaded if browser/shell supports it. Otherwise the1395// .wasm.js fallback will be used.1396//1397// If WASM=2 is enabled and the browser fails to compile the WebAssembly module,1398// the page will be reloaded in Wasm2JS mode.1399// [link]1400var WASM = 1;14011402// Indicates that we want to emit a wasm file that can run without JavaScript.1403// The file will use standard APIs such as wasi as much as possible to achieve1404// that.1405//1406// This option does not guarantee that the wasm can be used by itself - if you1407// use APIs with no non-JS alternative, we will still use those (e.g., OpenGL1408// at the time of writing this). This gives you the option to see which APIs1409// are missing, and if you are compiling for a custom wasi embedding, to add1410// those to your embedding.1411//1412// We may still emit JS with this flag, but the JS should only be a convenient1413// way to run the wasm on the Web or in Node.js, and you can run the wasm by1414// itself without that JS (again, unless you use APIs for which there is no1415// non-JS alternative) in a wasm runtime like wasmer or wasmtime.1416//1417// Note that even without this option we try to use wasi etc. syscalls as much1418// as possible. What this option changes is that we do so even when it means1419// a tradeoff with JS size. For example, when this option is set we do not1420// import the Memory - importing it is useful for JS, so that JS can start to1421// use it before the wasm is even loaded, but in wasi and other wasm-only1422// environments the expectation is to create the memory in the wasm itself.1423// Doing so prevents some possible JS optimizations, so we only do it behind1424// this flag.1425//1426// When this flag is set we do not legalize the JS interface, since the wasm is1427// meant to run in a wasm VM, which can handle i64s directly. If we legalized it1428// the wasm VM would not recognize the API. However, this means that the1429// optional JS emitted won't run if you use a JS API with an i64. You can use1430// the WASM_BIGINT option to avoid that problem by using BigInts for i64s which1431// means we don't need to legalize for JS (but this requires a new enough JS1432// VM).1433//1434// Standalone builds require a ``main`` entry point by default. If you want to1435// build a library (also known as a reactor) instead you can pass ``--no-entry``.1436// [link]1437var STANDALONE_WASM = false;14381439// Whether to ignore implicit traps when optimizing in binaryen. Implicit1440// traps are the traps that happen in a load that is out of bounds, or1441// div/rem of 0, etc. With this option set, the optimizer assumes that loads1442// cannot trap, and therefore that they have no side effects at all. This1443// is *not* safe in general, as you may have a load behind a condition which1444// ensures it it is safe; but if the load is assumed to not have side effects it1445// could be executed unconditionally. For that reason this option is generally1446// not useful on large and complex projects, but in a small and simple enough1447// codebase it may help reduce code size a little bit.1448// [link]1449var BINARYEN_IGNORE_IMPLICIT_TRAPS = false;14501451// A comma-separated list of extra passes to run in the binaryen optimizer.1452// Setting this does not override/replace the default passes. It is appended at1453// the end of the list of passes.1454// [link]1455var BINARYEN_EXTRA_PASSES = "";14561457// Whether to compile the wasm asynchronously, which is more efficient and does1458// not block the main thread. This is currently required for all but the1459// smallest modules to run in chrome.1460//1461// (This option was formerly called BINARYEN_ASYNC_COMPILATION)1462// [link]1463var WASM_ASYNC_COMPILATION = true;14641465// If set to 1, the dynCall() and dynCall_sig() API is made available1466// to caller.1467// [link]1468var DYNCALLS = false;14691470// WebAssembly integration with JavaScript BigInt. When enabled we don't need to1471// legalize i64s into pairs of i32s, as the wasm VM will use a BigInt where an1472// i64 is used.1473// [link]1474var WASM_BIGINT = true;14751476// WebAssembly defines a "producers section" which compilers and tools can1477// annotate themselves in, and LLVM emits this by default.1478// Emscripten will strip that out so that it is *not* emitted because it1479// increases code size, and also some users may not want information1480// about their tools to be included in their builds for privacy or security1481// reasons, see1482// https://github.com/WebAssembly/tool-conventions/issues/93.1483// [link]1484var EMIT_PRODUCERS_SECTION = false;14851486// Emits emscripten license info in the JS output.1487// [link]1488var EMIT_EMSCRIPTEN_LICENSE = false;14891490// Whether to legalize the JS FFI interfaces (imports/exports) by wrapping them1491// to automatically demote i64 to i32 and promote f32 to f64. This is necessary1492// in order to interface with JavaScript. For non-web/non-JS embeddings,1493// setting this to 0 may be desirable.1494// [link]1495// [deprecated]1496var LEGALIZE_JS_FFI = true;14971498// Ports14991500// Specify the SDL version that is being linked against.1501// 1, the default, is 1.3, which is implemented in JS1502// 2 is a port of the SDL C code on emscripten-ports1503// When AUTO_JS_LIBRARIES is set to 0 this defaults to 0 and SDL1504// is not linked in.1505// Alternate syntax for using the port: --use-port=sdl21506// [compile+link]1507var USE_SDL = 0;15081509// Specify the SDL_gfx version that is being linked against. Must match USE_SDL1510// [compile+link]1511var USE_SDL_GFX = 0;15121513// Specify the SDL_image version that is being linked against. Must match USE_SDL1514// [compile+link]1515var USE_SDL_IMAGE = 1;15161517// Specify the SDL_ttf version that is being linked against. Must match USE_SDL1518// [compile+link]1519var USE_SDL_TTF = 1;15201521// Specify the SDL_net version that is being linked against. Must match USE_SDL1522// [compile+link]1523var USE_SDL_NET = 1;15241525// 1 = use icu from emscripten-ports1526// Alternate syntax: --use-port=icu1527// [compile+link]1528var USE_ICU = false;15291530// 1 = use zlib from emscripten-ports1531// Alternate syntax: --use-port=zlib1532// [compile+link]1533var USE_ZLIB = false;15341535// 1 = use bzip2 from emscripten-ports1536// Alternate syntax: --use-port=bzip21537// [compile+link]1538var USE_BZIP2 = false;15391540// 1 = use giflib from emscripten-ports1541// Alternate syntax: --use-port=giflib1542// [compile+link]1543var USE_GIFLIB = false;15441545// 1 = use libjpeg from emscripten-ports1546// Alternate syntax: --use-port=libjpeg1547// [compile+link]1548var USE_LIBJPEG = false;15491550// 1 = use libpng from emscripten-ports1551// Alternate syntax: --use-port=libpng1552// [compile+link]1553var USE_LIBPNG = false;15541555// 1 = use Regal from emscripten-ports1556// Alternate syntax: --use-port=regal1557// [compile+link]1558var USE_REGAL = false;15591560// 1 = use Boost headers from emscripten-ports1561// Alternate syntax: --use-port=boost_headers1562// [compile+link]1563var USE_BOOST_HEADERS = false;15641565// 1 = use bullet from emscripten-ports1566// Alternate syntax: --use-port=bullet1567// [compile+link]1568var USE_BULLET = false;15691570// 1 = use vorbis from emscripten-ports1571// Alternate syntax: --use-port=vorbis1572// [compile+link]1573var USE_VORBIS = false;15741575// 1 = use ogg from emscripten-ports1576// Alternate syntax: --use-port=ogg1577// [compile+link]1578var USE_OGG = false;15791580// 1 = use mpg123 from emscripten-ports1581// Alternate syntax: --use-port=mpg1231582// [compile+link]1583var USE_MPG123 = false;15841585// 1 = use freetype from emscripten-ports1586// Alternate syntax: --use-port=freetype1587// [compile+link]1588var USE_FREETYPE = false;15891590// Specify the SDL_mixer version that is being linked against.1591// Doesn't *have* to match USE_SDL, but a good idea.1592// [compile+link]1593var USE_SDL_MIXER = 1;15941595// 1 = use harfbuzz from harfbuzz upstream1596// Alternate syntax: --use-port=harfbuzz1597// [compile+link]1598var USE_HARFBUZZ = false;15991600// 3 = use cocos2d v3 from emscripten-ports1601// Alternate syntax: --use-port=cocos2d1602// [compile+link]1603var USE_COCOS2D = 0;16041605// 1 = use libmodplug from emscripten-ports1606// Alternate syntax: --use-port=libmodplug1607// [compile+link]1608var USE_MODPLUG = false;16091610// Formats to support in SDL2_image. Valid values: bmp, gif, lbm, pcx, png, pnm,1611// tga, xcf, xpm, xv1612// [compile+link]1613var SDL2_IMAGE_FORMATS = [];16141615// Formats to support in SDL2_mixer. Valid values: ogg, mp3, mod, mid1616// [compile+link]1617var SDL2_MIXER_FORMATS = ["ogg"];16181619// 1 = use sqlite3 from emscripten-ports1620// Alternate syntax: --use-port=sqlite31621// [compile+link]1622var USE_SQLITE3 = false;16231624// If 1, target compiling a shared Wasm Memory.1625// [compile+link]1626var SHARED_MEMORY = false;16271628// Enables support for Wasm Workers. Wasm Workers enable applications1629// to create threads using a lightweight web-specific API that builds on top1630// of Wasm SharedArrayBuffer + Atomics API.1631// [compile+link]1632var WASM_WORKERS = 0;16331634// If true, enables targeting Wasm Web Audio AudioWorklets. Check out the1635// full documentation in site/source/docs/api_reference/wasm_audio_worklets.rst1636//1637// Note: The setting will implicitly add ``worklet`` to the :ref:`ENVIRONMENT`,1638// (i.e. the resulting code and run in a worklet environment) but additionaly1639// depends on ``WASM_WORKERS`` and Wasm SharedArrayBuffer to run new Audio1640// Worklets.1641// [link]1642var AUDIO_WORKLET = 0;16431644// If true, enables utilizing k- and a-rate AudioParams based properties in1645// Wasm Audio Worklet code. If false, AudioParams are not used. Set to false1646// for a tiny improvement to code size and AudioWorklet CPU performance when1647// audio synthesis is synchronized using custom WebAssembly Memory-based means.1648// [link]1649var AUDIO_WORKLET_SUPPORT_AUDIO_PARAMS = true;16501651// If true, enables deep debugging of Web Audio backend.1652// [link]1653var WEBAUDIO_DEBUG = 0;16541655// In web browsers, Workers cannot be created while the main browser thread1656// is executing JS/Wasm code, but the main thread must regularly yield back1657// to the browser event loop for Worker initialization to occur.1658// This means that pthread_create() is essentially an asynchronous operation1659// when called from the main browser thread, and the main thread must1660// repeatedly yield back to the JS event loop in order for the thread to1661// actually start.1662// If your application needs to be able to synchronously create new threads,1663// you can pre-create a pthread pool by specifying -sPTHREAD_POOL_SIZE=x,1664// in which case the specified number of Workers will be preloaded into a pool1665// before the application starts, and that many threads can then be available1666// for synchronous creation.1667// Note that this setting is a string, and will be emitted in the JS code1668// (directly, with no extra quotes) so that if you set it to '5' then 5 workers1669// will be used in the pool, and so forth. The benefit of this being a string1670// is that you can set it to something like1671// 'navigator.hardwareConcurrency' (which will use the number of cores the1672// browser reports, and is how you can get exactly enough workers for a1673// threadpool equal to the number of cores).1674// [link] - affects generated JS runtime code at link time1675var PTHREAD_POOL_SIZE = 0;16761677// Normally, applications can create new threads even when the pool is empty.1678// When application breaks out to the JS event loop before trying to block on1679// the thread via ``pthread_join`` or any other blocking primitive,1680// an extra Worker will be created and the thread callback will be executed.1681// However, breaking out to the event loop requires custom modifications to1682// the code to adapt it to the Web, and not something that works for1683// off-the-shelf apps. Those apps without any modifications are most likely1684// to deadlock. This setting ensures that, instead of a risking a deadlock,1685// they get a runtime EAGAIN error instead that can at least be gracefully1686// handled from the C / C++ side.1687// Values:1688//1689// - ``0`` - disable warnings on thread pool exhaustion1690// - ``1`` - enable warnings on thread pool exhaustion (default)1691// - ``2`` - make thread pool exhaustion a hard error1692//1693// [link]1694var PTHREAD_POOL_SIZE_STRICT = 1;16951696// If your application does not need the ability to synchronously create1697// threads, but it would still like to opportunistically speed up initial thread1698// startup time by prewarming a pool of Workers, you can specify the size of1699// the pool with -sPTHREAD_POOL_SIZE=x, but then also specify1700// -sPTHREAD_POOL_DELAY_LOAD, which will cause the runtime to not wait up at1701// startup for the Worker pool to finish loading. Instead, the runtime will1702// immediately start up and the Worker pool will asynchronously spin up in1703// parallel on the background. This can shorten the time that pthread_create()1704// calls take to actually start a thread, but without actually slowing down1705// main application startup speed. If PTHREAD_POOL_DELAY_LOAD=0 (default),1706// then the runtime will wait for the pool to start up before running main().1707// If you do need to synchronously wait on the created threads1708// (e.g. via pthread_join), you must wait on the Module.pthreadPoolReady1709// promise before doing so or you're very likely to run into deadlocks.1710// [link] - affects generated JS runtime code at link time1711var PTHREAD_POOL_DELAY_LOAD = false;17121713// Default stack size to use for newly created pthreads. When not set, this1714// defaults to STACK_SIZE (which in turn defaults to 64k). Can also be set at1715// runtime using pthread_attr_setstacksize(). Note that the wasm control flow1716// stack is separate from this stack. This stack only contains certain function1717// local variables, such as those that have their addresses taken, or ones that1718// are too large to fit as local vars in wasm code.1719// [link]1720var DEFAULT_PTHREAD_STACK_SIZE = 0;17211722// True when building with --threadprofiler1723// [link]1724var PTHREADS_PROFILING = false;17251726// It is dangerous to call pthread_join or pthread_cond_wait1727// on the main thread, as doing so can cause deadlocks on the Web (and also1728// it works using a busy-wait which is expensive). See1729// https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread1730// This may become set to 0 by default in the future; for now, this just1731// warns in the console.1732// [link]1733var ALLOW_BLOCKING_ON_MAIN_THREAD = true;17341735// If true, add in debug traces for diagnosing pthreads related issues.1736// [link]1737var PTHREADS_DEBUG = false;17381739// This tries to evaluate code at compile time. The main use case is to eval1740// global ctor functions, which are those that run before main(), but main()1741// itself or parts of it can also be evalled. Evaluating code this way can avoid1742// work at runtime, as it applies the results of the execution to memory and1743// globals and so forth, "snapshotting" the wasm and then just running it from1744// there when it is loaded.1745//1746// This will stop when it sees something it cannot eval at compile time, like a1747// call to an import. When running with this option you will see logging that1748// indicates what is evalled and where it stops.1749//1750// This optimization can either reduce or increase code size. If a small amount1751// of code generates many changes in memory, for example, then overall size may1752// increase.1753//1754// LLVM's GlobalOpt *almost* does this operation. It does in simple cases, where1755// LLVM IR is not too complex for its logic to evaluate, but it isn't powerful1756// enough for e.g. libc++ iostream ctors. It is just hard to do at the LLVM IR1757// level - LLVM IR is complex and getting more complex, so this would require1758// GlobalOpt to have a full interpreter, plus a way to write back into LLVM IR1759// global objects. At the wasm level, however, everything has been lowered1760// into a simple low level, and we also just need to write bytes into an array,1761// so this is easy for us to do. A further issue for LLVM is that it doesn't1762// know that we will not link in further code, so it only tries to optimize1763// ctors with lowest priority (while we do know explicitly if dynamic linking is1764// enabled or not).1765//1766// If set to a value of 2, this also makes some "unsafe" assumptions,1767// specifically that there is no input received while evalling ctors. That means1768// we ignore args to main() as well as assume no environment vars are readable.1769// This allows more programs to be optimized, but you need to make sure your1770// program does not depend on those features - even just checking the value of1771// argc can lead to problems.1772//1773// [link]1774var EVAL_CTORS = 0;17751776// The default value or 1 means the generated code will use TextDecoder if1777// available and fall back to custom decoder code when not available.1778// If set to 2, we assume TextDecoder is present and usable, and do not emit1779// any JS code to fall back if it is missing. Setting this zero to avoid even1780// conditional usage of TextDecoder is no longer supported.1781// Note: In -Oz builds, the default value of TEXTDECODER is set to 2, to save on1782// code size (except when AUDIO_WORKLET is specified, or when `shell` is part1783// of ENVIRONMENT since TextDecoder is not available in those environments).1784// [link]1785var TEXTDECODER = 1;17861787// Embind specific: If enabled, assume UTF-8 encoded data in std::string binding.1788// Disable this to support binary data transfer.1789// [link]1790var EMBIND_STD_STRING_IS_UTF8 = true;17911792// Embind specific: If enabled, generate Embind's JavaScript invoker functions1793// at compile time and include them in the JS output file. When used with1794// DYNAMIC_EXECUTION=0 this allows exported bindings to be just as fast as1795// DYNAMIC_EXECUTION=1 mode, but without the need for eval(). If there are many1796// bindings the JS output size may be larger though.1797var EMBIND_AOT = false;17981799// If set to 1, enables support for transferring canvases to pthreads and1800// creating WebGL contexts in them, as well as explicit swap control for GL1801// contexts. This needs browser support for the OffscreenCanvas specification.1802// [link]1803var OFFSCREENCANVAS_SUPPORT = false;18041805// If you are using PROXY_TO_PTHREAD with OFFSCREENCANVAS_SUPPORT, then specify1806// here a comma separated list of CSS ID selectors to canvases to proxy over1807// to the pthread at program startup, e.g. '#canvas1, #canvas2'.1808// [link]1809var OFFSCREENCANVASES_TO_PTHREAD = "#canvas";18101811// If set to 1, enables support for WebGL contexts to render to an offscreen1812// render target, to avoid the implicit swap behavior of WebGL where exiting any1813// event callback would automatically perform a "flip" to present rendered1814// content on screen. When an Emscripten GL context has Offscreen Framebuffer1815// enabled, a single frame can be composited from multiple event callbacks, and1816// the swap function emscripten_webgl_commit_frame() is then explicitly called1817// to present the rendered content on screen.1818//1819// The OffscreenCanvas feature also enables explicit GL frame swapping support,1820// and also, -sOFFSCREEN_FRAMEBUFFER feature can be used to polyfill support1821// for accessing WebGL in multiple threads in the absence of OffscreenCanvas1822// support in browser, at the cost of some performance and latency.1823// OffscreenCanvas and Offscreen Framebuffer support can be enabled at the same1824// time, and allows one to utilize OffscreenCanvas where available, and to fall1825// back to Offscreen Framebuffer otherwise.1826// [link]1827var OFFSCREEN_FRAMEBUFFER = false;18281829// If nonzero, Fetch API supports backing to IndexedDB. If 0, IndexedDB is not1830// utilized. Set to 0 if IndexedDB support is not interesting for target1831// application, to save a few kBytes.1832// [link]1833var FETCH_SUPPORT_INDEXEDDB = true;18341835// If nonzero, prints out debugging information in library_fetch.js1836// [link]1837var FETCH_DEBUG = false;18381839// If nonzero, enables emscripten_fetch API.1840// [link]1841var FETCH = false;18421843// Enables streaming fetched data when the fetch attribute1844// EMSCRIPTEN_FETCH_STREAM_DATA is used. For streaming requests, the DOM Fetch1845// API is used otherwise XMLHttpRequest is used.1846// Both modes generally support the same API, but there are some key1847// differences:1848//1849// - XHR supports synchronous requests1850// - XHR supports overriding mime types1851// - Fetch supports streaming data using the 'onprogress' callback1852//1853// If set to a value of 2, only the DOM Fetch backend will be used. This should1854// only be used in testing.1855// [link]1856var FETCH_STREAMING = 0;18571858// ATTENTION [WIP]: Experimental feature. Please use at your own risk.1859// This will eventually replace the current JS file system implementation.1860// If set to 1, uses new filesystem implementation.1861// [link]1862// [experimental]1863var WASMFS = false;18641865// If set to 1, embeds all subresources in the emitted file as base64 string1866// literals. Embedded subresources may include (but aren't limited to) wasm,1867// asm.js, and static memory initialization code.1868//1869// When using code that depends on this option, your Content Security Policy may1870// need to be updated. Specifically, embedding asm.js requires the script-src1871// directive to allow 'unsafe-inline', and using a Worker requires the1872// child-src directive to allow blob:. If you aren't using Content Security1873// Policy, or your CSP header doesn't include either script-src or child-src,1874// then you can safely ignore this warning.1875//1876// Note that SINGLE_FILE with binary encoding requires the HTML/JS files to be1877// served with UTF-8 encoding. See the details on SINGLE_FILE_BINARY_ENCODE.1878// [link]1879var SINGLE_FILE = false;18801881// If true, binary Wasm content is encoded using a custom UTF-8 embedding1882// instead of base64. This generates a smaller binary that compresses well.1883// Set this to false to revert back to earlier base64 encoding if you run into1884// issues with the binary encoding. (and please let us know of any such issues)1885// If no issues arise, this option will permanently become the default in the1886// future.1887//1888// NOTE: Binary encoding requires that the HTML/JS files are served with UTF-81889// encoding, and will not work with the default legacy Windows-1252 encoding1890// that browsers might use on Windows. To enable UTF-8 encoding in a1891// hand-crafted index.html file, apply any of:1892// 1. Add `<meta charset="utf-8">` inside the <head> section of HTML, or1893// 2. Add `<meta http-equiv="content-type" content="text/html; charset=UTF-8" />`` inside <head>, or1894// 3. Add `<meta http-equiv="content-type" content="application/json; charset=utf-8" />` inside <head>1895// (if using -o foo.js with SINGLE_FILE mode to build HTML+JS), or1896// 4. pass the header `Content-Type: text/html; charset=utf-8` and/or header1897// `Content-Type: application/javascript; charset=utf-8` when serving the1898// relevant files that contain binary encoded content.1899// If none of these are possible, disable binary encoding with1900// -sSINGLE_FILE_BINARY_ENCODE=0 to fall back to base64 encoding.1901// [link]1902var SINGLE_FILE_BINARY_ENCODE = true;19031904// If set to 1, all JS libraries will be automatically available at link time.1905// This gets set to 0 in STRICT mode (or with MINIMAL_RUNTIME) which mean you1906// need to explicitly specify -lfoo.js in at link time in order to access1907// library function in library_foo.js.1908// [link]1909var AUTO_JS_LIBRARIES = true;19101911// Like AUTO_JS_LIBRARIES but for the native libraries such as libgl, libal1912// and libhtml5. If this is disabled it is necessary to explicitly add1913// e.g. -lhtml5 and also to first build the library using ``embuilder``.1914// [link]1915var AUTO_NATIVE_LIBRARIES = true;19161917// Specifies the oldest major version of Firefox to target. I.e. all Firefox1918// versions >= MIN_FIREFOX_VERSION1919// are desired to work. Pass -sMIN_FIREFOX_VERSION=majorVersion to drop support1920// for Firefox versions older than majorVersion.1921// Firefox 79 was released on 2020-07-28.1922// MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported.1923// Minimum supported value is 68 which was released on 2019-07-09 (see1924// feature_matrix.py)1925// [link]1926var MIN_FIREFOX_VERSION = 79;19271928// Specifies the oldest version of desktop Safari to target. Version is encoded1929// in MMmmVV, e.g. 70101 denotes Safari 7.1.1.1930// Safari 14.1.0 was released on April 26, 2021, bundled with macOS 11.0 Big1931// Sur and iOS 14.5.1932// The previous default, Safari 12.0.0 was released on September 17, 2018,1933// bundled with macOS 10.14.0 Mojave.1934// NOTE: Emscripten is unable to produce code that would work in iOS 9.3.5 and1935// older, i.e. iPhone 4s, iPad 2, iPad 3, iPad Mini 1, Pod Touch 5 and older,1936// see https://github.com/emscripten-core/emscripten/pull/7191.1937// Multithreaded Emscripten code will need Safari 12.2 (iPhone 5s+) at minimum,1938// with support for DedicatedWorkerGlobalScope.name parameter.1939// MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported.1940// Minimum supported value is 120200 which was released on 2019-03-25 (see1941// feature_matrix.py).1942// [link]1943var MIN_SAFARI_VERSION = 150000;19441945// Specifies the oldest version of Chrome. E.g. pass -sMIN_CHROME_VERSION=78 to1946// drop support for Chrome 77 and older.1947// This setting also applies to modern Chromium-based Edge, which shares version1948// numbers with Chrome.1949// Chrome 85 was released on 2020-08-25.1950// MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported.1951// Minimum supported value is 74, which was released on 2019-04-23 (see1952// feature_matrix.py).1953// [link]1954var MIN_CHROME_VERSION = 85;19551956// Specifies minimum node version to target for the generated code. This is1957// distinct from the minimum version required to run the emscripten compiler.1958// Version is encoded in MMmmVV, e.g. 181401 denotes Node 18.14.01.1959// Minimum supported value is 122209, which was released 2022-01-11 (see1960// feature_matrix.py). This version aligns with the Ubuntu TLS 22.04 (Jammy).1961var MIN_NODE_VERSION = 160000;19621963// If true, uses minimal sized runtime without POSIX features, Module,1964// preRun/preInit/etc., Emscripten built-in XHR loading or library_browser.js.1965// Enable this setting to target the smallest code size possible. Set1966// MINIMAL_RUNTIME=2 to further enable even more code size optimizations. These1967// opts are quite hacky, and work around limitations in Closure and other parts1968// of the build system, so they may not work in all generated programs (But can1969// be useful for really small programs).1970//1971// By default, no symbols will be exported on the ``Module`` object. In order1972// to export kept alive symbols, please use ``-sEXPORT_KEEPALIVE=1``.1973// [link]1974var MINIMAL_RUNTIME = 0;19751976// If set to 1, MINIMAL_RUNTIME will utilize streaming WebAssembly compilation,1977// where WebAssembly module is compiled already while it is being downloaded.1978// In order for this to work, the web server MUST properly serve the .wasm file1979// with a HTTP response header "Content-Type: application/wasm". If this HTTP1980// header is not present, e.g. Firefox 73 will fail with an error message1981// ``TypeError: Response has unsupported MIME type``1982// and Chrome 78 will fail with an error message1983// `Uncaught (in promise) TypeError: Failed to execute 'compile' on1984// 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'`.1985// If set to 0 (default), streaming WebAssembly compilation is disabled, which1986// means that the WebAssembly Module will first be downloaded fully, and only1987// then compilation starts.1988// For large .wasm modules and production environments, this should be set to 11989// for faster startup speeds. However this setting is disabled by default1990// since it requires server side configuration and for really small pages there1991// is no observable difference (also has a ~100 byte impact to code size)1992// This setting is only compatible with html output.1993// [link]1994var MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION = false;19951996// If set to 1, MINIMAL_RUNTIME will utilize streaming WebAssembly instantiation,1997// where WebAssembly module is compiled+instantiated already while it is being1998// downloaded. Same restrictions/requirements apply as with1999// MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION.2000// MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION and2001// MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION cannot be simultaneously active.2002// Which one of these two is faster depends on the size of the wasm module,2003// the size of the JS runtime file, and the size of the preloaded data file2004// to download, and the browser in question.2005// [link]2006var MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION = false;20072008// If set to 'emscripten' or 'wasm', compiler supports setjmp() and longjmp().2009// If set to 0, these APIs are not available. If you are using C++ exceptions,2010// but do not need setjmp()+longjmp() API, then you can set this to 0 to save a2011// little bit of code size and performance when catching exceptions.2012//2013// 'emscripten': (default) Emscripten setjmp/longjmp handling using JavaScript2014// 'wasm': setjmp/longjmp handling using Wasm EH instructions (experimental)2015//2016// - 0: No setjmp/longjmp handling2017// - 1: Default setjmp/longjmp/handling, depending on the mode of exceptions.2018// 'wasm' if '-fwasm-exceptions' is used, 'emscripten' otherwise.2019//2020// At compile time this enables the transformations needed for longjmp support2021// at codegen time, while at link it allows linking in the library support.2022// [compile+link]2023var SUPPORT_LONGJMP = true;20242025// If set to 1, disables old deprecated HTML5 API event target lookup behavior.2026// When enabled, there is no "Module.canvas" object, no magic "null" default2027// handling, and DOM element 'target' parameters are taken to refer to CSS2028// selectors, instead of referring to DOM IDs.2029// [link]2030var DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR = true;20312032// Certain browser DOM API operations, such as requesting fullscreen mode2033// transition or pointer lock require that the request originates from within2034// a user initiated event, such as mouse click or keyboard press. Refactoring2035// an application to follow this kind of program structure can be difficult, so2036// HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS allows transparent emulation2037// of this by deferring such requests until a suitable event callback is2038// generated. Set this to 0 to disable support for deferring to save code2039// size if your application does not need support for deferred calls.2040// [link]2041var HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS = true;20422043// Specifies whether the generated .html file is run through html-minifier. The2044// set of optimization passes run by html-minifier depends on debug and2045// optimization levels. In -g2 and higher, no minification is performed. In -g1,2046// minification is done, but whitespace is retained. Minification requires at2047// least -O1 or -Os to be used. Pass -sMINIFY_HTML=0 to explicitly choose to2048// disable HTML minification altogether.2049// [link]2050var MINIFY_HTML = true;20512052// This option is no longer used. The appropriate shadow memory size is now2053// calculated from INITIAL_MEMORY and MAXIMUM_MEMORY. Will be removed in a2054// future release.2055// [link]2056var ASAN_SHADOW_SIZE = -1;20572058// List of path substitutions to apply in the "sources" field of the source map.2059// Corresponds to the ``--prefix`` option used in ``tools/wasm-sourcemap.py``.2060// Must be used with ``-gsource-map``.2061//2062// This setting allows to map path prefixes to the proper ones so that the final2063// (possibly relative) URLs point to the correct locations :2064// ``-sSOURCE_MAP_PREFIXES=/old/path=/new/path``2065//2066// [link]2067var SOURCE_MAP_PREFIXES = [];20682069// Default to c++ mode even when run as ``emcc`` rather than ``emc++``.2070// When this is disabled ``em++`` is required when linking C++ programs.2071// Disabling this will match the behaviour of gcc/g++ and clang/clang++.2072// [link]2073var DEFAULT_TO_CXX = true;20742075// While LLVM's wasm32 has long double = float128, we don't support printing2076// that at full precision by default. Instead we print as 64-bit doubles, which2077// saves libc code size. You can flip this option on to get a libc with full2078// long double printing precision.2079// [link]2080var PRINTF_LONG_DOUBLE = false;20812082// Setting this affects the path emitted in the wasm that refers to the DWARF2083// file, in -gseparate-dwarf mode. This allows the debugging file to be hosted2084// in a custom location.2085// [link]2086var SEPARATE_DWARF_URL = '';20872088// Emscripten runs wasm-ld to link, and in some cases will do further changes to2089// the wasm afterwards, like running wasm-opt to optimize the binary in2090// optimized builds. However, in some builds no wasm changes are necessary after2091// link. This can make the entire link step faster, and can also be important2092// for other reasons, like in debugging if the wasm is not modified then the2093// DWARF info from LLVM is preserved (wasm-opt can rewrite it in some cases, but2094// not in others like split-dwarf).2095// When this flag is turned on, we error at link time if the build requires any2096// changes to the wasm after link. This can be useful in testing, for example.2097// Some example of features that require post-link wasm changes are:2098//2099// - Lowering i64 to i32 pairs at the JS boundary (See WASM_BIGINT)2100// - Lowering sign-extension operation when targeting older browsers.2101var ERROR_ON_WASM_CHANGES_AFTER_LINK = false;21022103// Abort on unhandled exceptions that occur when calling exported WebAssembly2104// functions. This makes the program behave more like a native program where the2105// OS would terminate the process and no further code can be executed when an2106// unhandled exception (e.g. out-of-bounds memory access) happens.2107// This will instrument all exported functions to catch thrown exceptions and2108// call abort() when they happen. Once the program aborts any exported function2109// calls will fail with a "program has already aborted" exception to prevent2110// calls into code with a potentially corrupted program state.2111// This adds a small fixed amount to code size in optimized builds and a slight2112// overhead for the extra instrumented function indirection. Enable this if you2113// want Emscripten to handle unhandled exceptions nicely at the cost of a few2114// bytes extra.2115// Exceptions that occur within the ``main`` function are already handled via an2116// alternative mechanism.2117// [link]2118var ABORT_ON_WASM_EXCEPTIONS = false;21192120// Build binaries that use as many WASI APIs as possible, and include additional2121// JS support libraries for those APIs. This allows emscripten to produce2122// binaries that are more WASI compliant and also allows it to process and2123// execute WASI binaries built with other SDKs (e.g. wasi-sdk).2124// This setting is experimental and subject to change or removal.2125// Implies :ref:`STANDALONE_WASM`.2126// [link]2127// [experimental]2128var PURE_WASI = false;21292130// Set to 1 to define the WebAssembly.Memory object outside of the wasm2131// module. By default the wasm module defines the memory and exports2132// it to JavaScript.2133// Use of the following settings will enable this settings since they2134// depend on being able to define the memory in JavaScript:2135//2136// - -pthread2137// - RELOCATABLE2138// - ASYNCIFY_LAZY_LOAD_CODE2139// - WASM2JS (WASM=0)2140//2141// [link]2142var IMPORTED_MEMORY = false;21432144// Generate code to load split wasm modules.2145// This option will automatically generate two wasm files as output, one2146// with the ``.orig`` suffix and one without. The default file (without2147// the suffix) when run will generate instrumentation data that can later be2148// fed into wasm-split (the binaryen tool).2149// As well as this the generated JS code will contain helper functions2150// to load split modules.2151// [link]2152// [experimental]2153var SPLIT_MODULE = false;21542155// For MAIN_MODULE builds, automatically load any dynamic library dependencies2156// on startup, before loading the main module.2157var AUTOLOAD_DYLIBS = true;21582159// Include unimplemented JS syscalls to be included in the final output. This2160// allows programs that depend on these syscalls at runtime to be compiled, even2161// though these syscalls will fail (or do nothing) at runtime.2162var ALLOW_UNIMPLEMENTED_SYSCALLS = true;21632164// Allow calls to Worker(...) and importScripts(...) to be Trusted Types2165// compatible. Trusted Types is a Web Platform feature designed to mitigate DOM2166// XSS by restricting the usage of DOM sink APIs.2167// See https://w3c.github.io/webappsec-trusted-types/.2168// [link]2169var TRUSTED_TYPES = false;21702171// When targeting older browsers emscripten will sometimes require that2172// polyfills be included in the output. If you would prefer to take care of2173// polyfilling yourself via some other mechanism you can prevent emscripten2174// from generating these by passing ``-sNO_POLYFILL`` or ``-sPOLYFILL=0``2175// With default browser targets emscripten does not need any polyfills so this2176// settings is *only* needed when also explicitly targeting older browsers.2177var POLYFILL = true;21782179// If non-zero, add tracing to core runtime functions. Can be set to 2 for2180// extra tracing (for example, tracing that occurs on each turn of the event2181// loop or each user callback, which can flood the console).2182// This setting is enabled by default if any of the following debugging settings2183// are enabled:2184//2185// - PTHREADS_DEBUG2186// - DYLINK_DEBUG2187// - LIBRARY_DEBUG2188// - GL_DEBUG2189// - OPENAL_DEBUG2190// - EXCEPTION_DEBUG2191// - SYSCALL_DEBUG2192// - WEBSOCKET_DEBUG2193// - SOCKET_DEBUG2194// - FETCH_DEBUG2195//2196// [link]2197var RUNTIME_DEBUG = 0;21982199// Include JS library symbols that were previously part of the default runtime.2200// Without this, such symbols can be made available by adding them to2201// :ref:`DEFAULT_LIBRARY_FUNCS_TO_INCLUDE`, or via the dependencies of another2202// JS library symbol.2203var LEGACY_RUNTIME = false;22042205// User-defined functions to wrap with signature conversion, which take or2206// return pointer arguments. Only affects ``MEMORY64=1`` builds, see2207// ``create_pointer_conversion_wrappers`` in ``emscripten.py`` for details.2208// Use ``_`` for non-pointer arguments, ``p`` for pointer/i53 arguments, and2209// ``P`` for optional pointer/i53 values.2210// Example use ``-sSIGNATURE_CONVERSIONS=someFunction:_p,anotherFunction:p``2211// [link]2212var SIGNATURE_CONVERSIONS = [];22132214// Experimental support for wasm source phase imports.2215// This is only currently implemented in the pre-release/nightly version of2216// node, and not yet supported by browsers.2217// Requires EXPORT_ES62218// [link]2219// [experimental]2220var SOURCE_PHASE_IMPORTS = false;22212222// Experimental support for wasm ESM integration.2223// Requires :ref:`EXPORT_ES6` and ``MODULARIZE=instance``2224// [link]2225// [experimental]2226var WASM_ESM_INTEGRATION = false;22272228// Enable use of the JS arraybuffer-base64 API:2229// https://github.com/tc39/proposal-arraybuffer-base642230// To run the resulting code currently requires passing `--js_base_64` to node2231// or chrome.2232// [experimental]2233// [link]2234var JS_BASE64_API = false;22352236// Enable support for GrowableSharedArrayBuffer.2237// This features is only available behind a flag in recent versions of2238// node/chrome.2239// [experimental]2240// [link]2241var GROWABLE_ARRAYBUFFERS = false;22422243// Experimental support for WebAssembly js-types proposal.2244// It's currently only available under a flag in certain browsers,2245// so we disable it by default to save on code size.2246// [experimental]2247var WASM_JS_TYPES = false;22482249// If the emscripten-generated program is hosted on separate origin then2250// starting new pthread worker can violate CSP rules. Enabling2251// CROSS_ORIGIN uses an inline worker to instead load the worker script2252// indirectly using `importScripts`2253var CROSS_ORIGIN = false;22542255// This setting changes the behaviour of the ``-shared`` flag. The default2256// setting of ``true`` means the ``-shared`` flag actually produces a normal2257// object file (i.e. ``ld -r``). Setting this to false will cause ``-shared``2258// to behave like :ref:`SIDE_MODULE` and produce a dynamically linked2259// library.2260var FAKE_DYLIBS = true;22612262// Add a #! line to generated JS file and make it executable. This is useful2263// for building command line tools that run under node.2264// This setting can also be set to a string value, in which case that string2265// will be used as the #! command to embed in the generated file.2266var EXECUTABLE = false;226722682269