Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
205 lines (192 sloc) 6.79 KB
version: '{build}'
image:
- Visual Studio 2017
- Visual Studio 2015
configuration:
- Release
# - Debug
platform:
- x64
- Win32
matrix:
fast_finish: true
exclude:
# not installed
- { comp: 141, image: Visual Studio 2015 }
# duplicated - select only one
- { comp: 120, image: Visual Studio 2017 }
- { comp: 140, image: Visual Studio 2015 }
allow_failures:
- configuration: Debug
environment:
# use cache with 7z compression
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=9
# Use cygwin embedded gettext tools
path: '%path%;C:\cygwin64\bin'
# clcache config
clcVer: 4.1.0
# libcurl config
curlVer: 7_65_0
curldir: C:\curl-$(curlVer)
curlShared: OFF
# wxWidgets config
wxVer: 3.1.2
wxwin: C:\wxWidgets-$(wxver)-$(configuration)
wxShared: 0
wxURL: https://github.com/wxWidgets/wxWidgets/releases/download/v$(wxver)
# Microsoft compiler options
CL: /MP
matrix:
# - comp: 141
- { comp: 141, wxShared: 1 }
# - { comp: 141, xp: _xp }
# - { comp: 141, xp: _xp, wxShared: 1 }
# - comp: 140
# - { comp: 140, wxShared: 1 }
# - { comp: 140, xp: _xp }
# - { comp: 140, xp: _xp, wxShared: 1 }
# - comp: 120
# - { comp: 120, wxShared: 1 }
# - { comp: 120, xp: _xp }
- { comp: 120, xp: _xp, wxShared: 1 }
init:
# AppVeyor missing paths
- if "%VS150COMNTOOLS%"=="" set "VS150COMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools\"
# Set developer command prompt
- if %platform:~-2%==64 (set arch=amd64) else (set arch=amd64_x86)
- call set "vcvarsall=%%VS%comp%COMNTOOLS%%..\..\VC\vcvarsall.bat"
- if %comp%==141 set "vcvarsall=%VS150COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat"
- call "%vcvarsall%" %arch%
# detect MSVC compiler version
- for /f "tokens=1,2 delims=." %%a in ('cl 2^>^&1 ^| findstr /r "\<[0-9][0-9]*\.[0-9][0-9]*\."') do (
for %%c in (%%a%%b) do set "clver=%%c"
)
- echo %clver% > ..\MSVC_ver.txt
# Set wxWidgets library paths
- if %platform:~-2%==64 set wxSuff=_x64
- set "wxLibFolder=%wxwin%\lib\vc%comp%%xp%%wxSuff%"
- if %wxShared%==0 (set wxLibFolder=%wxLibFolder%_lib)
else (set wxLibFolder=%wxLibFolder%_dll)
# Set curl library paths
- set "curlLibFolder=%curldir%\vc%comp%%xp%%wxSuff%_%configuration%"
- if %curlShared%==OFF (set curlLibFolder=%curlLibFolder%_lib)
else (set curlLibFolder=%curlLibFolder%_dll)
# Print some info
- echo %APPVEYOR_BUILD_WORKER_IMAGE% %platform% v%comp%%xp% %configuration% %arch%
# clcache unique directory
- set "CLCACHE_DIR=C:\clcache-%APPVEYOR_BUILD_WORKER_IMAGE%-%platform%-v%comp%%xp%"
# prepare cmake options
- if %comp%==120 set "gen=12 2013"
- if %comp%==140 set "gen=14 2015"
- if %comp%==141 set "gen=15 2017"
- if %platform:~-2%==64 set "gen=%gen% Win64"
# Microsoft compiler debug symbols option
- if %configuration%==Debug (set "CL=%CL% /Z7")
cache:
- '%wxwin%\lib -> ..\MSVC_ver.txt'
- '%curlLibFolder% -> .appveyor.yml'
- '%CLCACHE_DIR% -> ..\MSVC_ver.txt'
install:
# setup clcache
- nuget install clcache -Version %clcVer% -ExcludeVersion -Verbosity quiet
- copy clcache\clcache-%clcVer%\clcache.exe clcache\clcache-%clcVer%\cl.exe
- if exist %APPVEYOR_BUILD_FOLDER%\clcache\clcache-%clcVer%\cl.exe set "PATH=%APPVEYOR_BUILD_FOLDER%\clcache\clcache-%clcVer%;%PATH%"
- clcache -s
# wxWidgets, try to download pre-compiled version first
- if %wxShared%==1 (
curl -fsL --fail-early
-O %wxURL%/wxMSW-%wxVer%_vc%comp%%xp%%wxSuff%_Dev.7z
-O %wxURL%/wxWidgets-%wxVer%-headers.7z &&
if %configuration%==Release
curl -fsL -O %wxURL%/wxMSW-%wxVer%_vc%comp%%xp%%wxSuff%_ReleaseDLL.7z
) || exit 0
- if not exist wxMSW-%wxVer%_vc%comp%%xp%%wxSuff%_Dev.7z
curl -fsSL -O %wxURL%/wxWidgets-%wxVer%.7z
- 7z x -y "-o%wxwin%" wx*-%wxVer%*.7z
# wxWidgets, build script from build/tools/msvs/officialbuild.bat
- if %configuration%==Release set "wxConf=BUILD=release"
- if not %platform:~-2%==64 set "wxFlags=CPPFLAGS=/arch:SSE CFLAGS=/arch:SSE"
- if not exist "%wxLibFolder%" (
echo Building wxWidgets %wxVer% &
cd %wxwin%\build\msw &&
nmake /nologo /s /f makefile.vc %wxConf% COMPILER_VERSION=%comp%%xp%
TARGET_CPU=%platform% DEBUG_INFO=default SHARED=%wxShared% VENDOR=mmex %wxFlags%
wxUSE_UNSAFE_WXSTRING_CONV=0
)
# libcurl
- if %configuration%==Debug (set "curlConf=-DENABLE_DEBUG=ON")
- if not exist "%curlLibFolder%" (
echo Building libcurl %curlVer% &
git clone -q --depth=1 --branch=curl-%curlVer% https://github.com/curl/curl.git %curldir%-src &&
mkdir %curldir%-src\build && cd %curldir%-src\build &&
cmake -T v%comp%%xp%,host=x64 -G "Visual Studio %gen%" %curlConf%
-DBUILD_CURL_EXE=OFF
-DBUILD_SHARED_LIBS=%curlShared%
-DCURL_DISABLE_LDAP=ON
-DCURL_DISABLE_LDAPS=ON
-DCURL_DISABLE_TELNET=ON
-DCURL_DISABLE_DICT=ON
-DCURL_DISABLE_FILE=ON
-DCURL_DISABLE_TFTP=ON
-DCURL_DISABLE_RTSP=ON
-DCURL_DISABLE_POP3=ON
-DCURL_DISABLE_IMAP=ON
-DCURL_DISABLE_SMTP=ON
-DCURL_DISABLE_GOPHER=ON
-DENABLE_MANUAL=OFF
-DCMAKE_USE_WINSSL=ON
-DBUILD_TESTING=OFF
-DCMAKE_INSTALL_PREFIX=%curlLibFolder%
.. &&
cmake --build . --target install --config %configuration%
-- /maxcpucount /verbosity:minimal /nologo /p:PreferredToolArchitecture=x64
)
before_build:
- cd %APPVEYOR_BUILD_FOLDER%
- git submodule update -q --init
# regenerate database files
- cd src\db &&
python ..\..\util\sqlite2cpp.py ..\..\database\tables.sql &&
python ..\..\util\sqliteupgrade2cpp.py ..\..\database\incremental_upgrade &&
del *.mmdbg sql*.sql
- cd %APPVEYOR_BUILD_FOLDER%
build_script:
- mkdir build & cd build
- if %configuration%==Debug
set "cmake_def=-DCMAKE_INSTALL_DEBUG_LIBRARIES=ON -DCMAKE_INSTALL_DEBUG_LIBRARIES_ONLY=ON"
- set "cmake_def=%cmake_def% -DCMAKE_PREFIX_PATH=%curlLibFolder%"
- cmake --graphviz=mmex.dot -T v%comp%%xp%,host=x64 -G "Visual Studio %gen%" %cmake_def% ..
- cmake --build . --target package --config %configuration%
-- /maxcpucount /verbosity:minimal /nologo /p:PreferredToolArchitecture=x64
after_build:
- clcache -s
# rename and move
- if %configuration%==Debug set "pkgsuff=-debug"
- for %%f in (*.exe *.zip) do
if /i %%~xf==.exe (move "%%f" "..\%%~nf%xp%%pkgsuff%.exe")
else (move "%%f" "..\%%~nf%xp%%pkgsuff%-portable.zip")
test: off
on_success:
# don't cache downloaded wxWidgets binaries
- if %wxShared%==1 (
if exist wxMSW-%wxVer%_vc%comp%%xp%%wxSuff%_Dev.7z
rmdir /s /q "%wxLibFolder%"
)
artifacts:
- path: '*.exe'
name: installer
- path: '*.zip'
name: portable
- path: build\mmex.dot
name: build dependency graph
deploy:
description: 'release created by AppVeyor CI'
provider: GitHub
auth_token: '%GitHub_auth_token%'
artifact: installer,portable
draft: true
prerelease: true
force_update: true
on:
appveyor_repo_tag: true # deploy on tag push only
configuration: Release # Debug contains non-redist MS DLLs
You can’t perform that action at this time.