forked from wxMaxima-developers/wxmaxima
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
166 lines (145 loc) · 5.78 KB
/
.appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# This file is based on:
# https://github.com/Ifsttar/I-Simpa/blob/master/appveyor.yml
version: '23.12.0-DevelopmentSnapshot_{build}'
image:
- Visual Studio 2022 # For MSVC 2022 builds only
# clone directory
clone_folder: c:\projects\wxMaxima
# Do not clone the entire git repository
clone_depth: 15
configuration:
- debug
environment:
# The wxWidgets version as referred to in the source package
WXVERSION: 3.2.4
# The wxWidgets version as referred to in the build folder
# Typically it'd be the wxWidgets version with an optional suffix
# to indicate build "epoch". The epoch changes are used to invalidate
# a cached wxWidgets build and force a rebuild.
WXBUILDVER: 3.2.4_0
CMAKEGEN: "Ninja"
matrix:
- TOOLKIT_INIT: ".appveyor\\MSVC_2022_x64.ps1"
WXW_LIB: vc_x64_lib
EXTRA_CMAKE_ARGS: ""
- TOOLKIT_INIT: ".appveyor\\MINGW_8.1.0_x64.ps1"
WXW_LIB: gcc_x64_lib
EXTRA_CMAKE_ARGS: "-DCMAKE_AR=C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/ar.exe"
matrix:
exclude:
- configuration: debug
TOOLKIT_INIT: ".appveyor\\MINGW_8.1.0_x64.ps1"
WXW_LIB: vc_x64_lib
- configuration: debug
TOOLKIT_INIT: ".appveyor\\MSVC_2022_x64.ps1"
WXW_LIB: gcc_x64_lib
cache:
- 'C:\wxwidgets-install_%WXBUILDVER%'
- 'C:\wxwidgets-build_%WXBUILDVER%'
# The build directory is only cached for the .pdb files. Other files are removed.
# - C:\ProgramData\chocolatey\bin -> appveyor.yml
# - C:\ProgramData\chocolatey\lib -> appveyor.yml
# Do not cache the build itself - we only care about the install!
# branches to build
branches:
except:
- gh_pages
- DebianPackaging
- DebianPackaging_NightlyBuild
install:
- ps: |
echo '- Starting the build'
echo " Job: $env:APPVEYOR_JOB_NAME"
echo " Branch: $env:APPVEYOR_REPO_BRANCH"
echo ''
echo '- Installing pandoc...'
choco install -y --no-progress pandoc
before_build:
- ps: |
iex $env:TOOLKIT_INIT
refreshenv
$SRC_ARCHIVE="wxWidgets-${env:WXVERSION}.7z"
$BUILD_DIR="C:\wxwidgets-build_${env:WXBUILDVER}"
$INSTALL_DIR="C:\wxwidgets-install_${env:WXBUILDVER}"
$INSTALL_LIB_DIR="$INSTALL_DIR\lib\${env:WXW_LIB}"
$SOURCE_DIR="C:\wxwidgets-source_${env:WXVERSION}"
copy C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/windres.exe C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/x86_64-w64-mingw32-windres.exe
# If there's no installation of wxWidgets available, we have to build it
if (!(Test-Path $INSTALL_DIR)) {
echo '- No wxWidgets installation $INSTALL_DIR was found'
echo '* Downloading wxWidgets sources'
Start-FileDownload "https://github.com/wxWidgets/wxWidgets/releases/download/v${env:WXVERSION}/$SRC_ARCHIVE"
echo '* Unpacking wxWidgets sources'
7z x "$SRC_ARCHIVE" "-o$SOURCE_DIR" -y
echo '* Building wxWidgets from sources'
mkdir $BUILD_DIR | Out-Null
pushd $BUILD_DIR
# Note: wxWidgets unity builds fail at least for version 3.1.3. This is a fixable problem but would
# require patching the CMakeLists there. So for now it's disabled, since we don'y rebuild wxWidgets
# often.
echo cmake -G "$env:CMAKEGEN" "$env:EXTRA_CMAKE_ARGS" -DCMAKE_BUILD_TYPE=Release `
-DwxBUILD_SHARED=NO `
-DwxUSE_STC=NO `
-DwxUSE_RIBBON=NO `
"-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR" -Wno-dev `
"$SOURCE_DIR"
cmake -G "$env:CMAKEGEN" "$env:EXTRA_CMAKE_ARGS" -DCMAKE_BUILD_TYPE=Release `
-DwxBUILD_SHARED=NO `
-DwxUSE_STC=NO `
-DwxUSE_RIBBON=NO `
"-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR" -Wno-dev `
"$SOURCE_DIR"
cmake --build .
cmake --install .
# Remove all files other than .pdb files - we do need those so that the build is quiet
Get-ChildItem -Recurse -File | Where {($_.Extension -ne ".pdb")} | Remove-Item
# List the PDB files for diagnostic purposes
Get-ChildItem -Recurse -File | Select-Object FullName
popd
}
$env:INSTALL_DIR = $INSTALL_DIR
$env:INSTALL_LIB_DIR = $INSTALL_LIB_DIR
- ps: |
$INSTALL_DIR = $env:INSTALL_DIR -replace '\\', '/'
$INSTALL_LIB_DIR = $env:INSTALL_LIB_DIR -replace '\\', '/'
echo '- Configuring wxMaxima'
echo " Job: $env:APPVEYOR_JOB_NAME"
echo " Branch: $env:APPVEYOR_REPO_BRANCH"
mkdir build | Out-Null
pushd build
# WX_ROOT_DIR is a workaround for a nasty bug in FindwxWidgets. Without it, the value
# of wxWidgets_LIB_DIR gets cleared (!) in FindwxWidgets.cmake(495)
# cmake issue report: https://gitlab.kitware.com/cmake/cmake/-/issues/19176
cmake -G "$env:CMAKEGEN" -DCMAKE_BUILD_TYPE=Release `
-DAPPVEYOR_BUILD=1 `
-DWX_ROOT_DIR="$INSTALL_DIR" `
-DwxWidgets_ROOT_DIR="$INSTALL_DIR" `
-DwxWidgets_LIB_DIR="$INSTALL_LIB_DIR" `
-DwxWidgets_CONFIGURATION=mswu `
$env:TOOLKIT_CMAKE_ARGS ..
popd
build_script:
- ps: |
echo '- Building wxMaxima'
echo " Job: $env:APPVEYOR_JOB_NAME"
echo " Branch: $env:APPVEYOR_REPO_BRANCH"
iex $env:TOOLKIT_INIT
pushd build
cmake --build .
if (! $?) { throw "CMake failed with exit code $LastExitCode" }
popd
test_script:
- ps: |
pushd build
#ctest -C Release
if (! $?) { throw "CTest failed with exit code $LastExitCode" }
popd
after_test:
- ps: |
echo '* Packing the installer'
pushd build
cpack -G NSIS
if (! $?) { throw "CPack failed with exit code $LastExitCode" }
popd
# echo '* Compressing the executable'
# 7z a wxMaxima.exe.7z build/src/*.exe