diff options
author | Brad King <brad.king@kitware.com> | 2022-11-11 13:26:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-11-11 13:26:32 (GMT) |
commit | b0f02511e59bc02441f6211ea1ca8810d0ee77a5 (patch) | |
tree | 0dd3dbc7c16bc725c1981e3e71969727c9ce60e0 | |
parent | f2b438cb0afb577ee87c8bc2295ed3d263fc85f2 (diff) | |
parent | 46b2849550821353f1eb513527c1f47dc761cc68 (diff) | |
download | CMake-b0f02511e59bc02441f6211ea1ca8810d0ee77a5.zip CMake-b0f02511e59bc02441f6211ea1ca8810d0ee77a5.tar.gz CMake-b0f02511e59bc02441f6211ea1ca8810d0ee77a5.tar.bz2 |
Merge topic 'ci-clang15-windows'
46b2849550 ci: Update LLVM/Clang to 15.0 in nightly CI jobs on Windows
3eb94e4d51 ci: Simplify LLVM/Clang CI job specs on Windows
8ba5835c8d ci: Factor out helper to load clang into environment on Windows
bf2e4a2e85 ci: Factor out helper to load ninja into environment on Windows
93ff726114 Tests: Fix TryCompile bad source case for clang-cl 15 on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7897
-rw-r--r-- | .gitlab-ci.yml | 24 | ||||
-rwxr-xr-x | .gitlab/ci/clang-env.ps1 | 15 | ||||
-rwxr-xr-x | .gitlab/ci/clang.ps1 | 14 | ||||
-rw-r--r-- | .gitlab/ci/env_windows_clang_common.cmake | 7 | ||||
-rw-r--r-- | .gitlab/ci/env_windows_clang_ninja.cmake | 1 | ||||
-rwxr-xr-x | .gitlab/ci/env_windows_clang_ninja.ps1 | 2 | ||||
-rw-r--r-- | .gitlab/ci/env_windows_clang_nmake.cmake | 1 | ||||
-rwxr-xr-x | .gitlab/ci/env_windows_clang_nmake.ps1 | 1 | ||||
-rwxr-xr-x | .gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 | 5 | ||||
-rwxr-xr-x | .gitlab/ci/ninja-env.ps1 | 4 | ||||
-rw-r--r-- | .gitlab/os-windows.yml | 19 | ||||
-rw-r--r-- | Tests/TryCompile/old_and_new_signature_tests.cmake | 2 |
12 files changed, 46 insertions, 49 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f732a0..644d871 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1000,10 +1000,10 @@ t:windows-borland5.8: variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang13.0-cl-ninja: +t:windows-clang15.0-cl-ninja: extends: - .windows_clang_ninja - - .cmake_test_windows_clang + - .cmake_test_windows_external - .windows_tags_concurrent - .cmake_junit_artifacts - .run_dependent @@ -1012,13 +1012,13 @@ t:windows-clang13.0-cl-ninja: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang13.0_cl_ninja + CMAKE_CI_BUILD_NAME: windows_clang15.0_cl_ninja CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang13.0-cl-nmake: +t:windows-clang15.0-cl-nmake: extends: - .windows_clang_nmake - - .cmake_test_windows_clang + - .cmake_test_windows_external - .windows_tags_concurrent - .cmake_junit_artifacts - .run_dependent @@ -1027,13 +1027,13 @@ t:windows-clang13.0-cl-nmake: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang13.0_cl_nmake + CMAKE_CI_BUILD_NAME: windows_clang15.0_cl_nmake CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang13.0-gnu-ninja: +t:windows-clang15.0-gnu-ninja: extends: - .windows_clang_ninja - - .cmake_test_windows_clang + - .cmake_test_windows_external - .windows_tags_concurrent - .cmake_junit_artifacts - .run_dependent @@ -1042,13 +1042,13 @@ t:windows-clang13.0-gnu-ninja: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang13.0_gnu_ninja + CMAKE_CI_BUILD_NAME: windows_clang15.0_gnu_ninja CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang13.0-gnu-nmake: +t:windows-clang15.0-gnu-nmake: extends: - .windows_clang_nmake - - .cmake_test_windows_clang + - .cmake_test_windows_external - .windows_tags_concurrent - .cmake_junit_artifacts - .run_dependent @@ -1057,7 +1057,7 @@ t:windows-clang13.0-gnu-nmake: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang13.0_gnu_nmake + CMAKE_CI_BUILD_NAME: windows_clang15.0_gnu_nmake CMAKE_CI_JOB_NIGHTLY: "true" t:mingw_osdn_io-mingw_makefiles: diff --git a/.gitlab/ci/clang-env.ps1 b/.gitlab/ci/clang-env.ps1 new file mode 100755 index 0000000..451fca3 --- /dev/null +++ b/.gitlab/ci/clang-env.ps1 @@ -0,0 +1,15 @@ +Invoke-Expression -Command .gitlab/ci/clang.ps1 +Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 + +$pwdpath = $pwd.Path +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\llvm\bin;$env:PATH" + +if ("$env:CMAKE_CI_BUILD_NAME" -match "(^|_)gnu(_|$)") { + $env:CC = "clang" + $env:CXX = "clang++" + clang --version +} else { + $env:CC = "clang-cl" + $env:CXX = "clang-cl" + clang-cl --version +} diff --git a/.gitlab/ci/clang.ps1 b/.gitlab/ci/clang.ps1 index 25d64ba..29db93d 100755 --- a/.gitlab/ci/clang.ps1 +++ b/.gitlab/ci/clang.ps1 @@ -1,10 +1,10 @@ $erroractionpreference = "stop" -if ("$env:CMAKE_CI_BUILD_NAME".Contains("clang13.0")) { - # LLVM/Clang 13.0 - # https://github.com/llvm/llvm-project/releases/tag/llvmorg-13.0.0 - $filename = "llvm-13.0.0-win-x86_64-1" - $sha256sum = "F1B7CE360DACBC9776D7F84BE714766D60CF3D47492AFE34C45D574D1C597264" +if ("$env:CMAKE_CI_BUILD_NAME".Contains("clang15.0")) { + # LLVM/Clang 15.0 + # https://github.com/llvm/llvm-project/releases/tag/llvmorg-15.0.4 + $filename = "llvm-15.0.4-win-x86_64-1" + $sha256sum = "9AA305084C20C27972E103E7B18AAC3F755E0534542AF62FC2F2BF5DDD3C4E1F" } else { throw ('unknown CMAKE_CI_BUILD_NAME: ' + "$env:CMAKE_CI_BUILD_NAME") } @@ -25,6 +25,7 @@ Add-Type -AssemblyName System.IO.Compression.FileSystem Move-Item -Path "$outdir\$filename" -Destination "$outdir\llvm" $bin = "$outdir\llvm\bin" +$lib = "$outdir\llvm\lib" $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" @@ -34,4 +35,7 @@ $null = New-Item -ItemType HardLink -Path "$bin\lld-link.exe" -Target "$bin\ $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\libiomp5md.dll" -Target "$bin\libomp.dll" +$null = New-Item -ItemType HardLink -Path "$lib\libiomp5md.lib" -Target "$lib\libomp.lib" Clear-Variable -Name bin +Clear-Variable -Name lib diff --git a/.gitlab/ci/env_windows_clang_common.cmake b/.gitlab/ci/env_windows_clang_common.cmake deleted file mode 100644 index fdd668f..0000000 --- a/.gitlab/ci/env_windows_clang_common.cmake +++ /dev/null @@ -1,7 +0,0 @@ -if("$ENV{CMAKE_CI_BUILD_NAME}" MATCHES "(^|_)gnu(_|$)") - set(ENV{CC} clang) - set(ENV{CXX} clang++) -else() - set(ENV{CC} clang-cl) - set(ENV{CXX} clang-cl) -endif() diff --git a/.gitlab/ci/env_windows_clang_ninja.cmake b/.gitlab/ci/env_windows_clang_ninja.cmake deleted file mode 100644 index f3834a2..0000000 --- a/.gitlab/ci/env_windows_clang_ninja.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/env_windows_clang_common.cmake") diff --git a/.gitlab/ci/env_windows_clang_ninja.ps1 b/.gitlab/ci/env_windows_clang_ninja.ps1 new file mode 100755 index 0000000..17002ef --- /dev/null +++ b/.gitlab/ci/env_windows_clang_ninja.ps1 @@ -0,0 +1,2 @@ +. .gitlab/ci/ninja-env.ps1 +. .gitlab/ci/clang-env.ps1 diff --git a/.gitlab/ci/env_windows_clang_nmake.cmake b/.gitlab/ci/env_windows_clang_nmake.cmake deleted file mode 100644 index f3834a2..0000000 --- a/.gitlab/ci/env_windows_clang_nmake.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/env_windows_clang_common.cmake") diff --git a/.gitlab/ci/env_windows_clang_nmake.ps1 b/.gitlab/ci/env_windows_clang_nmake.ps1 new file mode 100755 index 0000000..89fa360 --- /dev/null +++ b/.gitlab/ci/env_windows_clang_nmake.ps1 @@ -0,0 +1 @@ +. .gitlab/ci/clang-env.ps1 diff --git a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 index e5f538a..44bb090 100755 --- a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 +++ b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 @@ -2,9 +2,6 @@ if ("$env:CMAKE_CI_NIGHTLY" -eq "true") { . ".gitlab/ci/ispc-env.ps1" } -$pwdpath = $pwd.Path -& "$pwsh" -File ".gitlab/ci/ninja.ps1" -Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH" -ninja --version +. .gitlab/ci/ninja-env.ps1 Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 diff --git a/.gitlab/ci/ninja-env.ps1 b/.gitlab/ci/ninja-env.ps1 new file mode 100755 index 0000000..67c7036 --- /dev/null +++ b/.gitlab/ci/ninja-env.ps1 @@ -0,0 +1,4 @@ +$pwdpath = $pwd.Path +& "$pwsh" -File ".gitlab/ci/ninja.ps1" +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH" +Write-Host "ninja version: $(ninja --version)" diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 271610b..0933802 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -322,11 +322,9 @@ - Set-Item -Force -Path "env:WIX" -Value "$pwdpath\.gitlab\wix" - (& "$pwsh" -File ".gitlab/ci/cmake.ps1") - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH" - - (& "$pwsh" -File ".gitlab/ci/ninja.ps1") - - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH" + - . .gitlab/ci/ninja-env.ps1 - (& "$env:WIX\bin\light.exe" -help) | Select -First 1 - cmake --version - - ninja --version - cmake -P .gitlab/ci/download_qt.cmake - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\qt\bin;$env:PATH" - cmake -P .gitlab/ci/download_python3.cmake @@ -415,21 +413,6 @@ interruptible: true -.cmake_test_windows_clang: - stage: test-ext - - script: - - . .gitlab/ci/env.ps1 - - $pwdpath = $pwd.Path - - (& "$pwsh" -File ".gitlab/ci/ninja.ps1") - - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH" - - Invoke-Expression -Command .gitlab/ci/clang.ps1 - - Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 - - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\llvm\bin;$env:PATH" - - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake - - interruptible: true - .cmake_test_windows_msvc: stage: test-ext diff --git a/Tests/TryCompile/old_and_new_signature_tests.cmake b/Tests/TryCompile/old_and_new_signature_tests.cmake index ab548f7..1373ad7 100644 --- a/Tests/TryCompile/old_and_new_signature_tests.cmake +++ b/Tests/TryCompile/old_and_new_signature_tests.cmake @@ -117,7 +117,7 @@ try_compile(SHOULD_FAIL_DUE_TO_BAD_SOURCE if(SHOULD_FAIL_DUE_TO_BAD_SOURCE AND NOT CMAKE_GENERATOR MATCHES "Watcom WMake|NMake Makefiles") string(REPLACE "\n" "\n " output " ${output}") message(SEND_ERROR "try_compile with bad#source.c did not fail:\n${output}") -elseif(NOT output MATCHES [[(bad#source\.c|bad\.c|bad')]]) +elseif(NOT output MATCHES [[(bad#source\.c|bad\.c|bad[':])]]) string(REPLACE "\n" "\n " output " ${output}") message(SEND_ERROR "try_compile with bad#source.c failed without mentioning bad source:\n${output}") else() |