Skip to content

Commit 13176b9

Browse files
committed
Remove unused internal setting: EMSCRIPTEN_VERSION. NFC
1 parent 1f463d1 commit 13176b9

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/settings_internal.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ var WASI_MODULE_NAME = "wasi_snapshot_preview1";
106106
// implicitly linked libraries added by the JS compiler.
107107
var JS_LIBRARIES = [];
108108

109-
// This will contain the emscripten version. This can be useful in combination
110-
// with RETAIN_COMPILER_SETTINGS
111-
var EMSCRIPTEN_VERSION = '';
112-
113109
// Will be set to 0 if -fno-rtti is used on the command line.
114110
var USE_RTTI = true;
115111

test/core/emscripten_get_compiler_setting.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ int main() {
1313
printf("INVOKE_RUN: %ld\n", emscripten_get_compiler_setting("INVOKE_RUN"));
1414
assert((unsigned)emscripten_get_compiler_setting("OPT_LEVEL") <= 3);
1515
assert((unsigned)emscripten_get_compiler_setting("DEBUG_LEVEL") <= 4);
16-
printf("EMSCRIPTEN_VERSION: %s\n", (char*)emscripten_get_compiler_setting("EMSCRIPTEN_VERSION"));
16+
printf("CLOSURE_WARNINGS: %s\n", (char*)emscripten_get_compiler_setting("CLOSURE_WARNINGS"));
1717
}
1818

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
INVOKE_RUN: 1
2-
EMSCRIPTEN_VERSION: waka
2+
CLOSURE_WARNINGS: quiet

test/test_core.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,9 +1920,7 @@ def test_emscripten_get_now(self):
19201920
def test_emscripten_get_compiler_setting(self):
19211921
if not self.is_optimizing() and ('-flto' in self.cflags or '-flto=thin' in self.cflags):
19221922
self.skipTest('https://github.com/emscripten-core/emscripten/issues/25015')
1923-
expected = read_file(test_file('core/emscripten_get_compiler_setting.out'))
1924-
expected = expected.replace('waka', utils.EMSCRIPTEN_VERSION)
1925-
self.do_runf('core/emscripten_get_compiler_setting.c', expected, cflags=['-sRETAIN_COMPILER_SETTINGS'])
1923+
self.do_core_test('emscripten_get_compiler_setting.c', cflags=['-sRETAIN_COMPILER_SETTINGS'])
19261924

19271925
def test_emscripten_get_compiler_setting_error(self):
19281926
# with assertions, a runtime error is shown if you try to use the API without RETAIN_COMPILER_SETTINGS

tools/link.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1809,7 +1809,6 @@ def get_full_import_name(name):
18091809
'emscripten_stack_get_base',
18101810
'emscripten_stack_get_end']
18111811

1812-
settings.EMSCRIPTEN_VERSION = utils.EMSCRIPTEN_VERSION
18131812
settings.SOURCE_MAP_BASE = options.source_map_base or ''
18141813

18151814
settings.LINK_AS_CXX = (shared.run_via_emxx or settings.DEFAULT_TO_CXX) and not options.nostdlibxx

tools/maint/find_unused_settings.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,20 @@
1818

1919

2020
def main():
21+
print(f'Searching {len(settings.internal_settings)} internal settings')
22+
for key in settings.internal_settings:
23+
#print('CHECKING:', key)
24+
cmd = ['git', 'grep', '-q', f'\\<{key}\\>', '*.mjs', '*.js', ':(exclude)src/settings.js', ':(exclude)src/settings_internal.js']
25+
if subprocess.run(cmd, check=False).returncode:
26+
print('NOT FOUND IN JS:', key)
27+
2128
print(f'Searching {len(settings.attrs)} settings')
2229
for key in settings.attrs:
30+
#print('CHECKING:', key)
2331
cmd = ['git', 'grep', '-q', f'\\<{key}\\>', ':(exclude)src/settings.js', ':(exclude)src/settings_internal.js']
24-
print('CHECKING:', key)
2532
# git grep returns 0 if there is a match and non-zero when there is not
2633
if subprocess.run(cmd, check=False).returncode:
27-
print('NOT FOUND: ', key)
34+
print('NOT FOUND ANYWHERE:', key)
2835

2936

3037
if __name__ == '__main__':

0 commit comments

Comments
 (0)