Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/settings_internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ var WASI_MODULE_NAME = "wasi_snapshot_preview1";
// implicitly linked libraries added by the JS compiler.
var JS_LIBRARIES = [];

// This will contain the emscripten version. This can be useful in combination
// with RETAIN_COMPILER_SETTINGS
var EMSCRIPTEN_VERSION = '';

// Will be set to 0 if -fno-rtti is used on the command line.
var USE_RTTI = true;

Expand Down
2 changes: 1 addition & 1 deletion test/core/emscripten_get_compiler_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ int main() {
printf("INVOKE_RUN: %ld\n", emscripten_get_compiler_setting("INVOKE_RUN"));
assert((unsigned)emscripten_get_compiler_setting("OPT_LEVEL") <= 3);
assert((unsigned)emscripten_get_compiler_setting("DEBUG_LEVEL") <= 4);
printf("EMSCRIPTEN_VERSION: %s\n", (char*)emscripten_get_compiler_setting("EMSCRIPTEN_VERSION"));
printf("CLOSURE_WARNINGS: %s\n", (char*)emscripten_get_compiler_setting("CLOSURE_WARNINGS"));
}

2 changes: 1 addition & 1 deletion test/core/emscripten_get_compiler_setting.out
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
INVOKE_RUN: 1
EMSCRIPTEN_VERSION: waka
CLOSURE_WARNINGS: quiet
4 changes: 1 addition & 3 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1920,9 +1920,7 @@ def test_emscripten_get_now(self):
def test_emscripten_get_compiler_setting(self):
if not self.is_optimizing() and ('-flto' in self.cflags or '-flto=thin' in self.cflags):
self.skipTest('https://github.com/emscripten-core/emscripten/issues/25015')
expected = read_file(test_file('core/emscripten_get_compiler_setting.out'))
expected = expected.replace('waka', utils.EMSCRIPTEN_VERSION)
self.do_runf('core/emscripten_get_compiler_setting.c', expected, cflags=['-sRETAIN_COMPILER_SETTINGS'])
self.do_core_test('emscripten_get_compiler_setting.c', cflags=['-sRETAIN_COMPILER_SETTINGS'])

def test_emscripten_get_compiler_setting_error(self):
# with assertions, a runtime error is shown if you try to use the API without RETAIN_COMPILER_SETTINGS
Expand Down
1 change: 0 additions & 1 deletion tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -1809,7 +1809,6 @@ def get_full_import_name(name):
'emscripten_stack_get_base',
'emscripten_stack_get_end']

settings.EMSCRIPTEN_VERSION = utils.EMSCRIPTEN_VERSION
settings.SOURCE_MAP_BASE = options.source_map_base or ''

settings.LINK_AS_CXX = (shared.run_via_emxx or settings.DEFAULT_TO_CXX) and not options.nostdlibxx
Expand Down
11 changes: 9 additions & 2 deletions tools/maint/find_unused_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@


def main():
print(f'Searching {len(settings.internal_settings)} internal settings')
for key in settings.internal_settings:
#print('CHECKING:', key)
cmd = ['git', 'grep', '-q', f'\\<{key}\\>', '*.mjs', '*.js', ':(exclude)src/settings.js', ':(exclude)src/settings_internal.js']
if subprocess.run(cmd, check=False).returncode:
print('NOT FOUND IN JS:', key)

print(f'Searching {len(settings.attrs)} settings')
for key in settings.attrs:
#print('CHECKING:', key)
cmd = ['git', 'grep', '-q', f'\\<{key}\\>', ':(exclude)src/settings.js', ':(exclude)src/settings_internal.js']
print('CHECKING:', key)
# git grep returns 0 if there is a match and non-zero when there is not
if subprocess.run(cmd, check=False).returncode:
print('NOT FOUND: ', key)
print('NOT FOUND ANYWHERE:', key)


if __name__ == '__main__':
Expand Down