Skip to content

Commit

Permalink
Modified Windows build batch file
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Simon committed Jul 10, 2019
1 parent 05293af commit 7b8c204
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
8 changes: 6 additions & 2 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ isfile("deps.jl") && rm("deps.jl")

if Sys.iswindows()
libfile = joinpath(libdir, "libtesselate.dll")
arch = "x86"
if Sys.WORD_SIZE == 64
arch = "x64"
end
@build_steps begin
FileRule(libfile, @build_steps begin
BinDeps.run(@build_steps begin
ChangeDirectory(srcdir)
`cmd /c compile.bat all`
`cmd /c compile.bat all $arch`
`cmd /c copy libtesselate.dll $libfile`
`cmd /c copy triangle.h $headerdir`
`cmd /c copy tesselate.h $headerdir`
`cmd /c copy commondefine.h $headerdir`
`cmd /c compile.bat clean`
`cmd /c compile.bat clean $arch`
end) end) end

provides(Binaries, URI(libfile), libtesselate)
Expand Down
26 changes: 16 additions & 10 deletions deps/src/compile.bat
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
@echo off

echo %~dp0VC
if "%2" == "" goto x64
if "%2" == "x64" goto x64
if "%2" == "x86" goto x86

set VCPOS=%USERPROFILE%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0
set VCINSTALLDIR=%VCPOS%\VC\
set WindowsSdkDir=%VCPOS%\WinSDK\
if not exist "%VCINSTALLDIR%Bin\amd64\cl.exe" goto missing
set PATH=%VCINSTALLDIR%Bin\amd64;%WindowsSdkDir%Bin\x64;%WindowsSdkDir%Bin;%PATH%
set INCLUDE=%VCINSTALLDIR%Include;%WindowsSdkDir%Include;%INCLUDE%
set LIB=%VCINSTALLDIR%Lib\amd64;%WindowsSdkDir%Lib\x64;%LIB%
set LIBPATH=%VCINSTALLDIR%Lib\amd64;%WindowsSdkDir%Lib\x64;%LIBPATH%
:x64
echo Setting x64
set VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\
call "%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
goto parsebuild

:x86
echo Setting x86
set VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\
call "%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build\vcvarsall.bat"
goto parsebuild

:parsebuild
if "%1" == "" goto all

if /i %1 == all goto all
Expand All @@ -28,4 +34,4 @@ goto :eof
:missing
echo The specified configuration type is missing. The tools for the
echo configuration might not be installed.
goto :eof
goto :eof

0 comments on commit 7b8c204

Please sign in to comment.