//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// An array of all symbols exported from all the side modules specified on the19// command line.20// These are raw symbol names and are not mangled to include the leading21// underscore.22var SIDE_MODULE_EXPORTS = [];2324// All symbols imported by side modules. These are symbols that the main25// module (or other side modules) will need to provide.26var SIDE_MODULE_IMPORTS = [];2728// Like EXPORTED_FUNCTIONS, but will not error if symbol is missing.29// The start/stop symbols are included by default so that then can be extracted30// from the binary and embedded into the generated JS. The PostEmscripten pass31// in binaryen will then strip these exports so they will not appear in the32// final shipping binary.33// They are included here rather than in REQUIRED_EXPORTS because not all34// programs contains EM_JS or EM_ASM data section, in which case these symbols35// won't exist.36var EXPORT_IF_DEFINED = ['__start_em_asm', '__stop_em_asm',37'__start_em_lib_deps', '__stop_em_lib_deps',38'__start_em_js', '__stop_em_js'];3940// Like EXPORTED_FUNCTIONS, but symbol is required to exist in native code.41// This means wasm-ld will fail if these symbols are missing.42var REQUIRED_EXPORTS = [];4344// stores the base name of the output file (-o TARGET_BASENAME.js)45var TARGET_BASENAME = '';4647// stores the base name (with extension) of the output JS file48var TARGET_JS_NAME = '';4950// Indicates that the syscalls (which we see statically) indicate that they need51// full filesystem support. Otherwise, when just a small subset are used, we can52// get away without including the full filesystem - in particular, if open() is53// never used, then we don't actually need to support operations on streams.54var SYSCALLS_REQUIRE_FILESYSTEM = true;5556// Whether EMCC_AUTODEBUG is on, which automatically instruments code for57// runtime logging that can help in debugging.58var AUTODEBUG = false;5960// Whether we should use binaryen's wasm2js to convert our wasm to JS. Set when61// wasm backend is in use with WASM=0 (to enable non-wasm output, we compile to62// wasm normally, then compile that to JS).63var WASM2JS = false;6465// Whether we should link in the runtime for ubsan.66// 0 means do not link ubsan, 1 means link minimal ubsan runtime.67// This is not meant to be used with `-s`. Instead, to use ubsan, use clang flag68// -fsanitize=undefined. To use minimal runtime, also pass69// `-fsanitize-minimal-runtime`.70var UBSAN_RUNTIME = 0;7172// Whether we should link in LSan's runtime library. This is intended to be used73// by -fsanitize=leak instead of used directly.74var USE_LSAN = false;7576// Whether we should link in ASan's runtime library. This is intended to be used77// by -fsanitize=leak instead of used directly.78var USE_ASAN = false;7980// Whether embind has been enabled.81var EMBIND = false;8283// Whether a TypeScript definition file has been requested.84var EMIT_TSD = false;8586// This will be true during the generation of code in run_embind_gen. Helpful87// for detecting if either TSD file or embind AOT JS generation is running.88var EMBIND_GEN_MODE = false;8990// Whether the main() function reads the argc/argv parameters.91var MAIN_READS_PARAMS = true;9293var WASI_MODULE_NAME = "wasi_snapshot_preview1";9495// List of JS libraries explicitly linked against. This includes JS specified96// on the command line via `-lfoo.js` / `--js-library`. It does not include97// implicitly linked libraries added by the JS compiler.98var JS_LIBRARIES = [];99100// This will contain the emscripten version. This can be useful in combination101// with external JS library files that need to check the version of emscripten102// they are being used with.103var EMSCRIPTEN_VERSION = '';104105// Will be set to 0 if -fno-rtti is used on the command line.106var USE_RTTI = true;107108// This will contain the optimization level (-Ox).109var OPT_LEVEL = 0;110111// This will contain the debug level (-gx).112var DEBUG_LEVEL = 0;113114// This will contain the shrink level (1 or 2 for -Os or -Oz, or just 0).115var SHRINK_LEVEL = 0;116117// Whether or not to emit the name section in the final wasm binary.118var EMIT_NAME_SECTION = false;119120// Whether we are emitting a symbol map.121var EMIT_SYMBOL_MAP = false;122123// List of symbols explicitly exported by user on the command line.124var USER_EXPORTS = [];125126// name of the file containing wasm binary, if relevant127var WASM_BINARY_FILE = '';128129// Base URL the source mapfile, if relevant130var SOURCE_MAP_BASE = '';131132// If set to 1 then base64 decoding functions will be included in the bundle.133// This is set internally when needed (SINGLE_FILE)134var SUPPORT_BASE64_EMBEDDING = false;135136// the possible environments the code may run in.137var ENVIRONMENT_MAY_BE_WEB = true;138var ENVIRONMENT_MAY_BE_WORKER = true;139var ENVIRONMENT_MAY_BE_NODE = true;140var ENVIRONMENT_MAY_BE_SHELL = true;141var ENVIRONMENT_MAY_BE_WEBVIEW = true;142var ENVIRONMENT_MAY_BE_AUDIO_WORKLET = true;143144// Whether to minify import and export names in the minify_wasm_js stage.145// Currently always off for MEMORY64.146var MINIFY_WASM_IMPORTS_AND_EXPORTS = false;147148// Whether to minify imported module names.149var MINIFY_WASM_IMPORTED_MODULES = false;150151// Whether to minify exports from the Wasm module.152var MINIFY_WASM_EXPORT_NAMES = true;153154// Used to track whether target environment supports the 'Promise.any'.155var SUPPORTS_PROMISE_ANY = false;156157// Internal: value of -flto argument (either full or thin)158var LTO = 0;159160// Whether we may be accessing the address 2GB or higher. If so, then we need161// to interpret incoming i32 pointers as unsigned.162//163// This setting does not apply (and is never set to true) under MEMORY64, since164// in that case we get 64-bit pointers coming through to JS (converting them to165// i53 in most cases).166var CAN_ADDRESS_2GB = false;167168// Whether to emit DWARF in a separate wasm file on the side (this is not called169// "split" because there is already a DWARF concept by that name).170// When DWARF is on the side, the main file has no DWARF info, while the side171// file, ending in .debug.wasm, has the same wasm binary + all the debug172// sections.173// This has no effect if DWARF is not being emitted.174var SEPARATE_DWARF = false;175176// Target WebAssembly exception handling instead of JavaScript-side exception177// handling. Furthermore, if WASM_LEGACY_EXCEPTIONS=1, then old legacy Wasm178// exception handling is used, and if WASM_LEGACY_EXCEPTIONS=0, then Wasm179// exception handling is targeted.180// Enabled by passing -fwasm-exceptions on the command line.181var WASM_EXCEPTIONS = false;182183// Set to true if the program has a main function. By default this is184// enabled, but if `--no-entry` is passed, or if `_main` is not part of185// EXPORTED_FUNCTIONS then this gets set to 0.186var EXPECT_MAIN = true;187188// If true, building against Emscripten's wasm heap memory profiler.189var MEMORYPROFILER = false;190191// Set automatically to :192// - 1 when using `-gsource-map`193// - 2 when using `gsource-map=inline` (embed sources content in source map)194var GENERATE_SOURCE_MAP = 0;195196var GENERATE_DWARF = false;197198// Memory layout. These are only used/set in RELOCATABLE builds. Otherwise199// memory layout is fixed in the wasm binary at link time.200var STACK_HIGH = 0;201var STACK_LOW = 0;202var HEAP_BASE = 0;203204// Used internally. set when there is a main() function.205// Also set when in a linkable module, as the main() function might206// arrive from a dynamically-linked library, and not necessarily207// the current compilation unit.208// Also set for STANDALONE_WASM since the _start function is needed to call209// static ctors, even if there is no user main.210var HAS_MAIN = false;211212// Set to true if we are linking as C++ and including C++ stdlibs213var LINK_AS_CXX = false;214215// Set when closure compiler may be run: Either emcc will run it, or the user216// might run it after emcc. Either way, some JS changes and annotations must be217// emitted in that case for closure compiler.218var MAYBE_CLOSURE_COMPILER = false;219220// List of closure args for the closure compiler.221// This list is populated from the --closure-args argument and can be extended222// in ports using settings.CLOSURE_ARGS223var CLOSURE_ARGS = [];224225// Set when some minimum browser version triggers doesn't support the minimum226// set of JavaScript features. This triggers transpilation using babel.227var TRANSPILE = false;228229// A copy of the default INCOMING_MODULE_JS_API. (Soon to230// include additional items).231var ALL_INCOMING_MODULE_JS_API = [];232233// List of all imports that are weak, and therefore allowed to be undefined at234// runtime. This is used by the JS compiler to avoid build-time warnings/errors235// when weak symbols are undefined. Only applies in the case of dynamic linking236// (MAIN_MODULE).237var WEAK_IMPORTS = [];238239var STACK_FIRST = false;240241var HAVE_EM_ASM = true;242243var PRE_JS_FILES = [];244245var POST_JS_FILES = [];246247// Set when -pthread / -sPTHREADS is passed248var PTHREADS = false;249250var MINIFY_WHITESPACE = true;251252var ASYNCIFY_IMPORTS_EXCEPT_JS_LIBS = [];253254var WARN_DEPRECATED = true;255256// WebGL 2 provides new garbage-free entry points to call to WebGL. Use257// those always when possible.258// We currently set this to false for certain browsers when large memory sizes259// (2gb+ or 4gb+) are used260var WEBGL_USE_GARBAGE_FREE_APIS = false;261262var INCLUDE_WEBGL1_FALLBACK = true;263264var MINIFICATION_MAP = '';265266var OUTPUT_FORMAT = '';267268// Whether we should load the WASM source map at runtime.269// This is enabled automatically when using -gsource-map with sanitizers.270var LOAD_SOURCE_MAP = false;271272var ALIASES = [];273274// List of public setting names (Used by RETAIN_COMPILER_SETTINGS)275var PUBLIC_SETTINGS = [];276277278