mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
Speed up Appveyor builds with ccache (#4823)
This commit is contained in:
@@ -183,6 +183,11 @@ if(WIN32)
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
# Reduce noise (at least for now)
|
# Reduce noise (at least for now)
|
||||||
set(CMAKE_${L}_FLAGS "${CMAKE_${L}_FLAGS} /wd4244 /wd4267")
|
set(CMAKE_${L}_FLAGS "${CMAKE_${L}_FLAGS} /wd4244 /wd4267")
|
||||||
|
# Make caching-friendly (store debug info inside object files)
|
||||||
|
foreach(T IN ITEMS ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE})
|
||||||
|
string(TOUPPER "${T}" T)
|
||||||
|
string(REGEX REPLACE "[-/]Z[iI]" "-Z7" CMAKE_${L}_FLAGS_${T} "${CMAKE_${L}_FLAGS_${T}}")
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
|
|||||||
12
appveyor.yml
12
appveyor.yml
@@ -27,6 +27,13 @@ for:
|
|||||||
|
|
||||||
clone_folder: '%SystemDrive%\%TR_ARCH%-project'
|
clone_folder: '%SystemDrive%\%TR_ARCH%-project'
|
||||||
|
|
||||||
|
cache:
|
||||||
|
- '%SystemDrive%\%TR_ARCH%-ccache'
|
||||||
|
|
||||||
|
init:
|
||||||
|
- pwsh: |
|
||||||
|
$Env:APPVEYOR_SAVE_CACHE_ON_ERROR = 'true'
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- pwsh: |
|
- pwsh: |
|
||||||
$Version = git describe --tags --abbrev=10 --always
|
$Version = git describe --tags --abbrev=10 --always
|
||||||
@@ -47,6 +54,7 @@ for:
|
|||||||
choco install nasm
|
choco install nasm
|
||||||
choco install jom
|
choco install jom
|
||||||
choco install wixtoolset --version 3.11.2
|
choco install wixtoolset --version 3.11.2
|
||||||
|
choco install ccache
|
||||||
|
|
||||||
Remove-Item -Path (Join-Path $Env:SystemDrive OpenSSL-Win32) -Recurse
|
Remove-Item -Path (Join-Path $Env:SystemDrive OpenSSL-Win32) -Recurse
|
||||||
Remove-Item -Path (Join-Path $Env:SystemDrive OpenSSL-Win64) -Recurse
|
Remove-Item -Path (Join-Path $Env:SystemDrive OpenSSL-Win64) -Recurse
|
||||||
@@ -62,12 +70,16 @@ for:
|
|||||||
$Env:PATH
|
$Env:PATH
|
||||||
) -join [System.IO.Path]::PathSeparator
|
) -join [System.IO.Path]::PathSeparator
|
||||||
|
|
||||||
|
$Env:CCACHE_DIR = "${Env:SystemDrive}\${Env:TR_ARCH}-ccache"
|
||||||
|
$Env:CCACHE_MAXSIZE = '500Mi'
|
||||||
|
|
||||||
Set-ExecutionPolicy -Scope Process Bypass
|
Set-ExecutionPolicy -Scope Process Bypass
|
||||||
|
|
||||||
try {
|
try {
|
||||||
& (Join-Path $Env:APPVEYOR_BUILD_FOLDER release windows main.ps1) `
|
& (Join-Path $Env:APPVEYOR_BUILD_FOLDER release windows main.ps1) `
|
||||||
-Mode Build `
|
-Mode Build `
|
||||||
-BuildArch $env:TR_ARCH `
|
-BuildArch $env:TR_ARCH `
|
||||||
|
-CCachePart App `
|
||||||
-PackDebugSyms:$($Env:APPVEYOR_REPO_BRANCH -eq "main" -or $Env:APPVEYOR_REPO_TAG -eq "true")
|
-PackDebugSyms:$($Env:APPVEYOR_REPO_BRANCH -eq "main" -or $Env:APPVEYOR_REPO_TAG -eq "true")
|
||||||
} catch {
|
} catch {
|
||||||
Write-Error ("{1}{0}{2}{0}{3}" -f [Environment]::NewLine, $_.ToString(), $_.InvocationInfo.PositionMessage, $_.ScriptStackTrace) -ErrorAction Continue
|
Write-Error ("{1}{0}{2}{0}{3}" -f [Environment]::NewLine, $_.ToString(), $_.InvocationInfo.PositionMessage, $_.ScriptStackTrace) -ErrorAction Continue
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ Param(
|
|||||||
[ValidateSet('All', 'Deps', 'App')]
|
[ValidateSet('All', 'Deps', 'App')]
|
||||||
[string] $BuildPart = 'All',
|
[string] $BuildPart = 'All',
|
||||||
|
|
||||||
|
[Parameter()]
|
||||||
|
[ValidateSet('None', 'All', 'Deps', 'App')]
|
||||||
|
[string] $CCachePart = 'None',
|
||||||
|
|
||||||
[Parameter()]
|
[Parameter()]
|
||||||
[string] $SourceDir,
|
[string] $SourceDir,
|
||||||
|
|
||||||
@@ -266,6 +270,14 @@ if ($Mode -eq 'Build') {
|
|||||||
$env:CXXFLAGS = $CompilerFlags -join ' '
|
$env:CXXFLAGS = $CompilerFlags -join ' '
|
||||||
$env:LDFLAGS = $LinkerFlags -join ' '
|
$env:LDFLAGS = $LinkerFlags -join ' '
|
||||||
|
|
||||||
|
if (@('All', 'Deps') -contains $CCachePart) {
|
||||||
|
$Env:CMAKE_C_COMPILER_LAUNCHER = 'ccache'
|
||||||
|
$Env:CMAKE_CXX_COMPILER_LAUNCHER = 'ccache'
|
||||||
|
} else {
|
||||||
|
$Env:CMAKE_C_COMPILER_LAUNCHER = ''
|
||||||
|
$Env:CMAKE_CXX_COMPILER_LAUNCHER = ''
|
||||||
|
}
|
||||||
|
|
||||||
if (@('All', 'Deps') -contains $BuildPart) {
|
if (@('All', 'Deps') -contains $BuildPart) {
|
||||||
Invoke-Build Expat
|
Invoke-Build Expat
|
||||||
Invoke-Build DBus
|
Invoke-Build DBus
|
||||||
@@ -275,6 +287,14 @@ if ($Mode -eq 'Build') {
|
|||||||
Invoke-Build Qt
|
Invoke-Build Qt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (@('All', 'App') -contains $CCachePart) {
|
||||||
|
$Env:CMAKE_C_COMPILER_LAUNCHER = 'ccache'
|
||||||
|
$Env:CMAKE_CXX_COMPILER_LAUNCHER = 'ccache'
|
||||||
|
} else {
|
||||||
|
$Env:CMAKE_C_COMPILER_LAUNCHER = ''
|
||||||
|
$Env:CMAKE_CXX_COMPILER_LAUNCHER = ''
|
||||||
|
}
|
||||||
|
|
||||||
if (@('All', 'App') -contains $BuildPart) {
|
if (@('All', 'App') -contains $BuildPart) {
|
||||||
Invoke-Build Transmission -NoCache -MoreArguments @($SourceDir, $SourceDir, $PackDebugSyms.IsPresent)
|
Invoke-Build Transmission -NoCache -MoreArguments @($SourceDir, $SourceDir, $PackDebugSyms.IsPresent)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user