Skip to content

Instantly share code, notes, and snippets.

@vvuk
Created May 24, 2018 00:07
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vvuk/01dc8a12678d1beffaa1e26549d03b02 to your computer and use it in GitHub Desktop.
Save vvuk/01dc8a12678d1beffaa1e26549d03b02 to your computer and use it in GitHub Desktop.
Generate "vcvarsall" equivalent for msys2 bash from vcvarsall
@ECHO OFF
set OLDPATH=%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64 > NUL:
echo export INCLUDE='%INCLUDE%'
echo export LIB='%LIB%'
echo export LIBPATH='%LIBPATH%'
call set NEWPATH=%%PATH:%OLDPATH%=%%
set NEWPATH=%NEWPATH:C:=/c%
set NEWPATH=%NEWPATH:\=/%
set NEWPATH=%NEWPATH:;=:%
echo export PATH="%NEWPATH%:$PATH"
@evandrocoan
Copy link

How to use it from msys2 bash?

@evandrocoan
Copy link

You have to call cmd set with quotes:

set "NEWPATH=%NEWPATH:C:=/c%"
set "NEWPATH=%NEWPATH:\=/%"
set "NEWPATH=%NEWPATH:;=:%"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment