mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-03 05:08:47 -06:00
Merge topic 'ci-swift-windows'
0909fb9d48ci: Enable Swift tests on Windowsa4e5715959Tests/SwiftOnly: Bump minimum required CMake to 3.5 Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Evan Wilde <etceterawilde@gmail.com> Merge-request: !9231
This commit is contained in:
1
.gitlab/.gitignore
vendored
1
.gitlab/.gitignore
vendored
@@ -16,6 +16,7 @@
|
||||
/python*
|
||||
/qt*
|
||||
/sccache*
|
||||
/swift
|
||||
/unstable-jom*
|
||||
/watcom
|
||||
/wix*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
|
||||
set(CMake_TEST_CPACK_INNOSETUP "ON" CACHE STRING "")
|
||||
set(CMake_TEST_ISPC "ON" CACHE STRING "")
|
||||
set(CMake_TEST_Swift "ON" CACHE STRING "")
|
||||
endif()
|
||||
set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
|
||||
|
||||
|
||||
@@ -34,6 +34,13 @@ if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "nvhpc_")
|
||||
)
|
||||
endif()
|
||||
|
||||
if ("$ENV{CMAKE_CONFIGURATION}" STREQUAL "windows_vs2022_x64_ninja")
|
||||
list(APPEND test_exclusions
|
||||
# FIXME(#25573): This test failure needs further investigation.
|
||||
"^SwiftMixLib$"
|
||||
)
|
||||
endif()
|
||||
|
||||
string(REPLACE ";" "|" test_exclusions "${test_exclusions}")
|
||||
if (test_exclusions)
|
||||
set(test_exclusions "(${test_exclusions})")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if ("$env:CMAKE_CI_NIGHTLY" -eq "true") {
|
||||
. ".gitlab/ci/innosetup-env.ps1"
|
||||
. ".gitlab/ci/ispc-env.ps1"
|
||||
. ".gitlab/ci/swift-env.ps1"
|
||||
}
|
||||
|
||||
6
.gitlab/ci/swift-env.ps1
Executable file
6
.gitlab/ci/swift-env.ps1
Executable file
@@ -0,0 +1,6 @@
|
||||
$pwdpath = $pwd.Path
|
||||
& "$pwsh" -File ".gitlab/ci/swift.ps1"
|
||||
Set-Item -Force -Path "env:DEVELOPER_DIR" -Value "$pwdpath\.gitlab\swift"
|
||||
Set-Item -Force -Path "env:SDKROOT" -Value "$pwdpath\.gitlab\swift\Platforms\Windows.platform\Developer\SDKs\Windows.sdk"
|
||||
Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\swift\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin;$env:PATH"
|
||||
swiftc --version
|
||||
38
.gitlab/ci/swift.ps1
Executable file
38
.gitlab/ci/swift.ps1
Executable file
@@ -0,0 +1,38 @@
|
||||
$erroractionpreference = "stop"
|
||||
|
||||
$version = "5.9.2"
|
||||
$sha256sum = "8C053108528EB2DAD84C33D6F0834A3A1444D21BA1A89D591AB149304A62F6B5"
|
||||
$filename = "swift-$version-win-x86_64-1"
|
||||
$tarball = "$filename.zip"
|
||||
|
||||
$outdir = $pwd.Path
|
||||
$outdir = "$outdir\.gitlab"
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
# This URL is only visible inside of Kitware's network. See above filename table.
|
||||
Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/internal/$tarball" -OutFile "$outdir\$tarball"
|
||||
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
|
||||
if ($hash.Hash -ne $sha256sum) {
|
||||
exit 1
|
||||
}
|
||||
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
|
||||
Move-Item -Path "$outdir\$filename" -Destination "$outdir\swift"
|
||||
Remove-Item "$outdir\$tarball"
|
||||
|
||||
$bin = "$outdir\swift\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\clang++.exe" -Target "$bin\clang.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\clang-cl.exe" -Target "$bin\clang.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\clang-cpp.exe" -Target "$bin\clang.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\ld.lld.exe" -Target "$bin\lld.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\ld64.lld.exe" -Target "$bin\lld.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\lld-link.exe" -Target "$bin\lld.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\llvm-dlltool.exe" -Target "$bin\llvm-ar.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\llvm-lib.exe" -Target "$bin\llvm-ar.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\llvm-ranlib.exe" -Target "$bin\llvm-ar.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\llvm-objcopy.exe" -Target "$bin\llvm-strip.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\swiftc.exe" -Target "$bin\swift.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\swift-api-digester.exe" -Target "$bin\swift-frontend.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\swift-autolink-extract.exe" -Target "$bin\swift-frontend.exe"
|
||||
$null = New-Item -ItemType HardLink -Path "$bin\swift-symbolgraph-extract.exe" -Target "$bin\swift-frontend.exe"
|
||||
Clear-Variable -Name bin
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
if(POLICY CMP0126)
|
||||
cmake_policy(SET CMP0126 NEW)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user