//1// @license2// Copyright 2019 The Emscripten Authors3// SPDX-License-Identifier: MIT4//56//7// Settings in this file work exactly like those in settings.js but are not8// set-able from the command line and therefore are not part of the public9// ABI. This means that these settings are an internal detail of the toolchain10// and can be added/removed/renamed without fear of breaking out users.11//1213// List of symbols exported from compiled code14// These are raw symbol names and are not mangled to include the leading15// underscore.16var WASM_EXPORTS = [];1718// Similar to above but only includes the global/data symbols.19var WASM_GLOBAL_EXPORTS = [];2021// An array of all symbols exported from all the side modules specified on the22// command line.23// These are raw symbol names and are not mangled to include the leading24// underscore.25var SIDE_MODULE_EXPORTS = [];2627// All symbols imported by side modules. These are symbols that the main28// module (or other side modules) will need to provide.29var SIDE_MODULE_IMPORTS = [];3031// Like EXPORTED_FUNCTIONS, but will not error if symbol is missing.32// The start/stop symbols are included by default so that then can be extracted33// from the binary and embedded into the generated JS. The PostEmscripten pass34// in binaryen will then strip these exports so they will not appear in the35// final shipping binary.36// They are included here rather than in REQUIRED_EXPORTS because not all37// programs contains EM_JS or EM_ASM data section, in which case these symbols38// won't exist.39var EXPORT_IF_DEFINED = ['__start_em_asm', '__stop_em_asm',40'__start_em_lib_deps', '__stop_em_lib_deps',41'__start_em_js', '__stop_em_js'];4243// Like EXPORTED_FUNCTIONS, but symbol is required to exist in native code.44// This means wasm-ld will fail if these symbols are missing.45var REQUIRED_EXPORTS = [];4647// stores the base name of the output file (-o TARGET_BASENAME.js)48var TARGET_BASENAME = '';4950// stores the base name (with extension) of the output JS file51var TARGET_JS_NAME = '';5253// Indicates that the syscalls (which we see statically) indicate that they need54// full filesystem support. Otherwise, when just a small subset are used, we can55// get away without including the full filesystem - in particular, if open() is56// never used, then we don't actually need to support operations on streams.57var SYSCALLS_REQUIRE_FILESYSTEM = true;5859// A list of feature flags to pass to each binaryen invocation (like wasm-opt,60// etc.). This is received from wasm-emscripten-finalize, which reads it from61// the features section.62var BINARYEN_FEATURES = [];6364// Whether EMCC_AUTODEBUG is on, which automatically instruments code for65// runtime logging that can help in debugging.66var AUTODEBUG = false;6768// Whether we should use binaryen's wasm2js to convert our wasm to JS. Set when69// wasm backend is in use with WASM=0 (to enable non-wasm output, we compile to70// wasm normally, then compile that to JS).71var WASM2JS = false;7273// Whether we should link in the runtime for ubsan.74// 0 means do not link ubsan, 1 means link minimal ubsan runtime.75// This is not meant to be used with `-s`. Instead, to use ubsan, use clang flag76// -fsanitize=undefined. To use minimal runtime, also pass77// `-fsanitize-minimal-runtime`.78var UBSAN_RUNTIME = 0;7980// Whether we should link in LSan's runtime library. This is intended to be used81// by -fsanitize=leak instead of used directly.82var USE_LSAN = false;8384// Whether we should link in ASan's runtime library. This is intended to be used85// by -fsanitize=leak instead of used directly.86var USE_ASAN = false;8788// Whether embind has been enabled.89var EMBIND = false;9091// Whether a TypeScript definition file has been requested.92var EMIT_TSD = false;9394// This will be true during the generation of code in run_embind_gen. Helpful95// for detecting if either TSD file or embind AOT JS generation is running.96var EMBIND_GEN_MODE = false;9798// Whether the main() function reads the argc/argv parameters.99var MAIN_READS_PARAMS = true;100101var WASI_MODULE_NAME = "wasi_snapshot_preview1";102103// List of JS libraries explicitly linked against. This includes JS specified104// on the command line via `-lfoo.js` / `--js-library`. It does not include105// implicitly linked libraries added by the JS compiler.106var JS_LIBRARIES = [];107108// This will contain the emscripten version. This can be useful in combination109// with RETAIN_COMPILER_SETTINGS110var EMSCRIPTEN_VERSION = '';111112// Will be set to 0 if -fno-rtti is used on the command line.113var USE_RTTI = true;114115// This will contain the optimization level (-Ox).116var OPT_LEVEL = 0;117118// This will contain the debug level (-gx).119var DEBUG_LEVEL = 0;120121// This will contain the shrink level (1 or 2 for -Os or -Oz, or just 0).122var SHRINK_LEVEL = 0;123124// Whether or not to emit the name section in the final wasm binaryen.125var EMIT_NAME_SECTION = false;126127// Whether we are emitting a symbol map.128var EMIT_SYMBOL_MAP = false;129130// List of symbols explicitly exported by user on the command line.131var USER_EXPORTS = [];132133// name of the file containing wasm binary, if relevant134var WASM_BINARY_FILE = '';135136// Base URL the source mapfile, if relevant137var SOURCE_MAP_BASE = '';138139// If set to 1 then base64 decoding functions will be included in the bundle.140// This is set internally when needed (SINGLE_FILE)141var SUPPORT_BASE64_EMBEDDING = false;142143// the possible environments the code may run in.144var ENVIRONMENT_MAY_BE_WEB = true;145var ENVIRONMENT_MAY_BE_WORKER = true;146var ENVIRONMENT_MAY_BE_NODE = true;147var ENVIRONMENT_MAY_BE_SHELL = true;148var ENVIRONMENT_MAY_BE_WEBVIEW = true;149150// Whether to minify import and export names in the minify_wasm_js stage.151// Currently always off for MEMORY64.152var MINIFY_WASM_IMPORTS_AND_EXPORTS = false;153154// Whether to minify imported module names.155var MINIFY_WASM_IMPORTED_MODULES = false;156157// Whether to minify exports from the Wasm module.158var MINIFY_WASM_EXPORT_NAMES = true;159160// Used to track whether target environment supports the 'globalThis' attribute.161var SUPPORTS_GLOBALTHIS = false;162163// Used to track whether target environment supports the 'Promise.any'.164var SUPPORTS_PROMISE_ANY = false;165166// Internal: value of -flto argument (either full or thin)167var LTO = 0;168169// Whether we may be accessing the address 2GB or higher. If so, then we need170// to interpret incoming i32 pointers as unsigned.171//172// This setting does not apply (and is never set to true) under MEMORY64, since173// in that case we get 64-bit pointers coming through to JS (converting them to174// i53 in most cases).175var CAN_ADDRESS_2GB = false;176177// Whether to emit DWARF in a separate wasm file on the side (this is not called178// "split" because there is already a DWARF concept by that name).179// When DWARF is on the side, the main file has no DWARF info, while the side180// file, ending in .debug.wasm, has the same wasm binary + all the debug181// sections.182// This has no effect if DWARF is not being emitted.183var SEPARATE_DWARF = false;184185// New WebAssembly exception handling186var WASM_EXCEPTIONS = false;187188// Set to true if the program has a main function. By default this is189// enabled, but if `--no-entry` is passed, or if `_main` is not part of190// EXPORTED_FUNCTIONS then this gets set to 0.191var EXPECT_MAIN = true;192193// If true, building against Emscripten's wasm heap memory profiler.194var MEMORYPROFILER = false;195196// Set automatically to :197// - 1 when using `-gsource-map`198// - 2 when using `gsource-map=inline` (embed sources content in souce map)199var GENERATE_SOURCE_MAP = 0;200201var GENERATE_DWARF = false;202203// Memory layout. These are only used/set in RELOCATABLE builds. Otherwise204// memory layout is fixed in the wasm binary at link time.205var STACK_HIGH = 0;206var STACK_LOW = 0;207var HEAP_BASE = 0;208209// Used internally. set when there is a main() function.210// Also set when in a linkable module, as the main() function might211// arrive from a dynamically-linked library, and not necessarily212// the current compilation unit.213// Also set for STANDALONE_WASM since the _start function is needed to call214// static ctors, even if there is no user main.215var HAS_MAIN = false;216217// Set to true if we are linking as C++ and including C++ stdlibs218var LINK_AS_CXX = false;219220// Set when closure compiler may be run: Either emcc will run it, or the user221// might run it after emcc. Either way, some JS changes and annotations must be222// emitted in that case for closure compiler.223var MAYBE_CLOSURE_COMPILER = false;224225// List of closure args for the closure compiler.226// This list is populated from the --closure-args argument and can be extended227// in ports using settings.CLOSURE_ARGS228var CLOSURE_ARGS = [];229230// Set when some minimum browser version triggers doesn't support the minimum231// set of JavaScript features. This triggers transpilation using babel.232var TRANSPILE = false;233234// A copy of the default the default INCOMING_MODULE_JS_API. (Soon to235// include additional items).236var ALL_INCOMING_MODULE_JS_API = [];237238// List of all imports that are weak, and therefore allowed to be undefined at239// runtime. This is used by the JS compiler to avoid build-time warnings/errors240// when weak symbols are undefined. Only applies in the case of dynamic linking241// (MAIN_MODULE).242var WEAK_IMPORTS = [];243244var STACK_FIRST = false;245246var HAVE_EM_ASM = true;247248var PRE_JS_FILES = [];249250var POST_JS_FILES = [];251252// Set when -pthread / -sPTHREADS is passed253var PTHREADS = false;254255var BULK_MEMORY = false;256257var MINIFY_WHITESPACE = true;258259var ASYNCIFY_IMPORTS_EXCEPT_JS_LIBS = [];260261var WARN_DEPRECATED = true;262263// WebGL 2 provides new garbage-free entry points to call to WebGL. Use264// those always when possible.265// We currently set this to false for certain browser when large memory sizes266// (2gb+ or 4gb+) are used267var WEBGL_USE_GARBAGE_FREE_APIS = false;268269var INCLUDE_WEBGL1_FALLBACK = true;270271var MINIFICATION_MAP = '';272273var OUTPUT_FORMAT = '';274275// Whether we should load the WASM source map at runtime.276// This is enabled automatically when using -gsource-map with sanitizers.277var LOAD_SOURCE_MAP = false;278279280