Skip to content

Instantly share code, notes, and snippets.

@uvguy
Last active February 22, 2018 10:33
Show Gist options
  • Save uvguy/e940b617c15e753d2ba7b28f47bd6068 to your computer and use it in GitHub Desktop.
Save uvguy/e940b617c15e753d2ba7b28f47bd6068 to your computer and use it in GitHub Desktop.
msvc 2017 desktop app x86 of preview 15.6 version toolset environtment variable
:: this script simply set needed env variable to perform command line compilation using vs2017 preview 2017 15.6 atw (At This Time Of Writing 22/02/2018)
:: you can adjust some important variable like VC2017PRODVERSION to point as your desired of cl.exe compiler driver version.
:: WINSDKVERSION is the version of your desired win sdk instalation version.
:: of course you can either prepand or add a new custom INCLUDE, LIB and PATH to point to your custom folder c++ libs include and paths.
:: this script is only work for desktop x86 target, you may figure out how to adjust for x64 version of cl.exe by ease :)
set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\Preview\Community
set VCINSTALLDIR=%VSINSTALLDIR%\Vc
set VC2017PRODVERSION=14.13.26127
set WINSDKVERSION=10.0.17095.0
SET VCROOTLIBSDIR=%VCINSTALLDIR%\Tools\MSVC\%VC2017PRODVERSION%
ECHO "SETTING WINDOWS SDK 10"
set DEV=C:\Program Files (x86)
set WindowsSdkDir=%DEV%\Windows Kits\10
set PATH=%WindowsSdkDir%\bin\%WINSDKVERSION%\x86;%PATH%;%VSINSTALLDIR%\MSBuild\15.0\Bin
set LIB=%WindowsSdkDir%\Lib\%WINSDKVERSION%\ucrt\x86;%WindowsSdkDir%\Lib\%WINSDKVERSION%\um\x86;%LIB%
set INCLUDE=%WindowsSdkDir%\Include\%WINSDKVERSION%\ucrt;%WindowsSdkDir%\Include\%WINSDKVERSION%\um;%WindowsSdkDir%\Include\%WINSDKVERSION%\shared;%WindowsSdkDir%\Include\%WINSDKVERSION%;%WindowsSdkDir%\Include\%WINSDKVERSION%\winrt;%WindowsSdkDir%\Include\%WINSDKVERSION%\cppwinrt
set TARGET_CPU=x86
ECHO "INCLUDING DIA SDK LIBS"
SET DIASDKROOTDIR=%VSINSTALLDIR%\DIA SDK
SET PATH=%path%;%DIASDKROOTDIR%\bin
set INCLUDE=%INCLUDE%;%DIASDKROOTDIR%\include
set LIB=%LIB%;%DIASDKROOTDIR%\lib
echo "including core stl vc and atl"
SET INCLUDE=%INCLUDE%;%VCROOTLIBSDIR%\atlmfc\include;%VCROOTLIBSDIR%\include
SET LIB=%LIB%;%VCROOTLIBSDIR%\atlmfc\lib\x86;%VCROOTLIBSDIR%\lib\x86;
SET PATH=%PATH%;%VCROOTLIBSDIR%\bin\Hostx86\x86
title MSVC 2017 desktop x86 Env ready !
echo done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment