Skip to content

Commit c678733

Browse files
authored
Remove support for building with Visual Studio 2017. Since Jan 29, 2022, upstream LLVM has required VS2019 or VS2022 to build. So it has not been possible to build emsdk from source with VS2017 for a year. llvm/llvm-project@058c5df (#1178)
1 parent 592b7b7 commit c678733

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

emsdk.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,6 @@ def vswhere(version):
257257
program_files = os.environ['ProgramFiles']
258258
vswhere_path = os.path.join(program_files, 'Microsoft Visual Studio', 'Installer', 'vswhere.exe')
259259
output = json.loads(subprocess.check_output([vswhere_path, '-latest', '-version', '[%s.0,%s.0)' % (version, version + 1), '-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', '-property', 'installationPath', '-format', 'json']))
260-
# Visual Studio 2017 Express is not included in the above search, and it
261-
# does not have the VC.Tools.x86.x64 tool, so do a catch-all attempt as a
262-
# fallback, to detect Express version.
263-
if not output:
264-
output = json.loads(subprocess.check_output([vswhere_path, '-latest', '-version', '[%s.0,%s.0)' % (version, version + 1), '-products', '*', '-property', 'installationPath', '-format', 'json']))
265-
if not output:
266-
return ''
267260
return str(output[0]['installationPath'])
268261
except Exception:
269262
return ''
@@ -288,24 +281,18 @@ def vs_filewhere(installation_path, platform, file):
288281
CMAKE_GENERATOR = 'Visual Studio 17'
289282
elif '--vs2019' in sys.argv:
290283
CMAKE_GENERATOR = 'Visual Studio 16'
291-
elif '--vs2017' in sys.argv:
292-
CMAKE_GENERATOR = 'Visual Studio 15'
293284
elif len(vswhere(17)) > 0:
294285
CMAKE_GENERATOR = 'Visual Studio 17'
295286
elif len(vswhere(16)) > 0:
296287
CMAKE_GENERATOR = 'Visual Studio 16'
297-
elif len(vswhere(15)) > 0:
298-
# VS2017 has an LLVM build issue, see
299-
# https://github.com/kripken/emscripten-fastcomp/issues/185
300-
CMAKE_GENERATOR = 'Visual Studio 15'
301288
elif which('mingw32-make') is not None and which('g++') is not None:
302289
CMAKE_GENERATOR = 'MinGW Makefiles'
303290
else:
304291
# No detected generator
305292
CMAKE_GENERATOR = ''
306293

307294

308-
sys.argv = [a for a in sys.argv if a not in ('--mingw', '--vs2017', '--vs2019', '--vs2022')]
295+
sys.argv = [a for a in sys.argv if a not in ('--mingw', '--vs2019', '--vs2022')]
309296

310297

311298
# Computes a suitable path prefix to use when building with a given generator.
@@ -314,8 +301,6 @@ def cmake_generator_prefix():
314301
return '_vs2022'
315302
if CMAKE_GENERATOR == 'Visual Studio 16':
316303
return '_vs2019'
317-
if CMAKE_GENERATOR == 'Visual Studio 15':
318-
return '_vs2017'
319304
elif CMAKE_GENERATOR == 'MinGW Makefiles':
320305
return '_mingw'
321306
# Unix Makefiles do not specify a path prefix for backwards path compatibility
@@ -2685,7 +2670,7 @@ def main(args):
26852670
purposes. Default: Enabled
26862671
--disable-assertions: Forces assertions off during the build.
26872672
2688-
--vs2017/--vs2019/--vs2022: If building from source, overrides to build
2673+
--vs2019/--vs2022: If building from source, overrides to build
26892674
using the specified compiler. When installing
26902675
precompiled packages, this has no effect.
26912676
Note: The same compiler specifier must be
@@ -2708,7 +2693,7 @@ def main(args):
27082693

27092694
if WINDOWS:
27102695
print('''
2711-
emsdk activate [--permanent] [--system] [--build=type] [--vs2017/--vs2019/--vs2022] <tool/sdk>
2696+
emsdk activate [--permanent] [--system] [--build=type] [--vs2019/--vs2022] <tool/sdk>
27122697
27132698
- Activates the given tool or SDK in the
27142699
environment of the current shell.
@@ -2722,7 +2707,7 @@ def main(args):
27222707
(uses Machine environment variables).
27232708
27242709
- If a custom compiler version was used to override
2725-
the compiler to use, pass the same --vs2017/--vs2019/--vs2022
2710+
the compiler to use, pass the same --vs2019/--vs2022
27262711
parameter here to choose which version to activate.
27272712
27282713
emcmdprompt.bat - Spawns a new command prompt window with the

0 commit comments

Comments
 (0)