Skip to content

Commit

Permalink
Merge pull request #95 from FileOnQ/features/8-additional-vs-version-…
Browse files Browse the repository at this point in the history
…support

automate finding vcvarsall to support more vs versions
  • Loading branch information
mitchelsellers authored Feb 25, 2022
2 parents c2085ce + 0ff78c9 commit 11e6f1e
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion build/libheif.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,52 @@ title Building libheif
set arch=%1
set config=%2
set thirdPartyPath=%3
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %arch%
set vcvar=
set progFile=


::check default
set vswhereFile="%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
if exist %vswhereFile% (
goto setprogfile
)
goto check86



:setprogfile
set progFile=%ProgramFiles%
goto vswhereFound



:check86
set vswhereFile86="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if exist "%vswhereFile86%" (
set progFile=%vswhereFile86%
goto vswhereFound
)
goto fileNotFound



:vswhereFound
set vcvar=
for /f "usebackq tokens=1 delims=" %%x in (`%progFile% -find **\vcvarsall.bat`) do set vcvar="%%~x"
if defined vcvar goto fileFound



:fileNotFound
echo "unable to find 'vcvarsall.bat'. visual studio c++ package needs to be installed"
exit /b 2



:fileFound
echo "vcvarsall.bat was found, continuing"

call %vcvar% %arch%
cd ../third-party/libheif-%arch%

mkdir build
Expand Down

0 comments on commit 11e6f1e

Please # to comment.