diff --git a/tools/shared.py b/tools/shared.py index 485c91a80f76d..c7704376736e9 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -1098,6 +1098,11 @@ def load(self, args=[]): settings = re.sub(r'var ([\w\d]+)', r'self.attrs["\1"]', settings) exec settings + # Apply default values for settings that are configured from environment variables. + if os.environ.get('EMSCRIPTEN_STRICT') and int(os.environ.get('EMSCRIPTEN_STRICT')) != 0: + # The default value -s ERROR_ON_UNDEFINED_SYMBOLS=0 is deprecated. Use the default value 1 in strict mode. + self.attrs['ERROR_ON_UNDEFINED_SYMBOLS'] = 1 + # Apply additional settings. First -O, then -s for i in range(len(args)): if args[i].startswith('-O'):