2019-02-25 16:38:25 +08:00
image : Visual Studio 2017
clone_folder : c:\projects\darknet
environment :
WORKSPACE : C:\projects
matrix :
- platform : Cygwin64
COMPILER : cygwin
CYGWIN_NOWINPATH : yes
CYGSH : C:\cygwin64\bin\bash -c
- platform : Win64
COMPILER : vs
VCPKG_ROOT : C:\projects\vcpkg
VCPKG_DEFAULT_TRIPLET : x64-windows
2019-02-28 22:57:03 +08:00
USE_CUDA : yes
2019-03-01 16:15:34 +08:00
CUDACXX : C:\CUDA\bin\nvcc.exe
CUDA_PATH : C:\CUDA\
2019-02-28 22:57:03 +08:00
- platform : Win64
COMPILER : vs
VCPKG_ROOT : C:\projects\vcpkg
VCPKG_DEFAULT_TRIPLET : x64-windows
USE_CUDA : no
2019-02-28 07:55:44 +08:00
- platform : Win64
COMPILER : vs
USE_INTEGRATED_LIBS : yes
2019-02-25 16:38:25 +08:00
install :
- if [%COMPILER%]==[vs] cinst cmake ninja
- if [%COMPILER%]==[vs] SET "PATH=C:\Program Files\CMake\bin;%PATH%"
- if [%COMPILER%]==[vs] call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
- if [%COMPILER%]==[cygwin] SET "PATH=C:\cygwin64\bin;C:\cygwin64\usr\bin;%PATH%"
- if [%COMPILER%]==[cygwin] SET PATH=%PATH:C:\Program Files\Git\usr\bin;=%
- git submodule -q update --init --recursive
- cd %WORKSPACE%\
2019-02-28 22:57:03 +08:00
- if [%USE_CUDA%]==[yes] curl -L https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_411.31_windows -o cuda_10.0.130_411.31_windows.exe
2019-03-01 16:15:34 +08:00
- if [%USE_CUDA%]==[yes] mkdir C:\CUDATEMP
- if [%USE_CUDA%]==[yes] mkdir C:\CUDA
- if [%USE_CUDA%]==[yes] 7z x cuda_10.0.130_411.31_windows.exe -oC:\CUDATEMP
- if [%USE_CUDA%]==[yes] cd C:\CUDATEMP
- if [%USE_CUDA%]==[yes] FOR /D %%G in ("*") DO xcopy C:\CUDATEMP\%%G\* C:\CUDA\ /s /y
- cd %WORKSPACE%\
2019-02-25 16:38:25 +08:00
- mkdir cygwin-downloads
- ps : if($env:COMPILER -eq "cygwin") { Invoke-WebRequest https://cygwin.com/setup-x86_64.exe -OutFile $env:WORKSPACE\cygwin-setup.exe }
- if [%COMPILER%]==[cygwin] %WORKSPACE%\cygwin-setup.exe --quiet-mode --no-shortcuts --no-startmenu --no-desktop --upgrade-also --root C:\cygwin64 --local-package-dir %WORKSPACE%\cygwin-downloads --packages gcc-g++,cmake,libopencv-devel
2019-02-28 07:55:44 +08:00
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] git clone https://github.com/Microsoft/vcpkg
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] cd %VCPKG_ROOT%
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] bootstrap-vcpkg.bat
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] vcpkg integrate install
2019-02-28 22:57:03 +08:00
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] if NOT [%USE_CUDA%]==[yes] vcpkg install opencv pthreads
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] if [%USE_CUDA%]==[yes] vcpkg install opencv[cuda] pthreads
2019-02-25 16:38:25 +08:00
- cd %WORKSPACE%\darknet\
- mkdir build_debug && cd build_debug
- if [%COMPILER%]==[cygwin] %CYGSH% 'cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Debug"'
2019-02-28 07:55:44 +08:00
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=%VCPKG_DEFAULT_TRIPLET%" -DCMAKE_BUILD_TYPE="Debug" ..
2019-02-25 16:38:25 +08:00
- cd ..
- mkdir build_release && cd build_release
- if [%COMPILER%]==[cygwin] %CYGSH% 'cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release"'
2019-02-28 07:55:44 +08:00
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=%VCPKG_DEFAULT_TRIPLET%" -DCMAKE_BUILD_TYPE="Release" ..
- if [%COMPILER%]==[vs] if [%USE_INTEGRATED_LIBS%]==[yes] cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" -DCMAKE_BUILD_TYPE="Release" ..
2019-02-25 16:38:25 +08:00
- cd ..
build_script :
2019-02-28 07:55:44 +08:00
- if [%COMPILER%]==[cygwin] cd build_debug && %CYGSH% 'cmake --build .' && cd ..
- if [%COMPILER%]==[cygwin] cd build_release && %CYGSH% 'cmake --build .' && cd ..
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] cd build_debug && cmake --build . --config Debug && cd ..
- if [%COMPILER%]==[vs] cd build_release && cmake --build . --config Release && cd ..