From 3616d57fa1215c06e1f8b26c27b057ba0c0f71f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Barto=C5=88?= Date: Thu, 22 Jun 2023 13:37:12 +0200 Subject: [PATCH] CMake build using VS2022 --- .github/scripts/setup-env.sh | 6 +++++- .github/workflows/build-cmake.yml | 4 ++-- .github/workflows/tests.yml | 2 ++ packaging/windows/internal/vc_env_helper.bat | 8 ++++++-- packaging/windows/internal/vc_install_helper.sh | 6 ------ 5 files changed, 15 insertions(+), 11 deletions(-) delete mode 100644 packaging/windows/internal/vc_install_helper.sh diff --git a/.github/scripts/setup-env.sh b/.github/scripts/setup-env.sh index d102735909e..e4af4e7c61a 100755 --- a/.github/scripts/setup-env.sh +++ b/.github/scripts/setup-env.sh @@ -54,7 +54,11 @@ echo '::endgroup::' if [[ "${OS_TYPE}" == windows && "${GPU_ARCH_TYPE}" == cuda ]]; then echo '::group::Install VisualStudio CUDA extensions on Windows' - TARGET_DIR="/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Microsoft/VC/v160/BuildCustomizations" + if [[ "${VC_YEAR:-}" == "2022" ]]; then + TARGET_DIR="/c/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Microsoft/VC/v170/BuildCustomizations" + else + TARGET_DIR="/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Microsoft/VC/v160/BuildCustomizations" + fi mkdir -p "${TARGET_DIR}" cp -r "${CUDA_HOME}/MSBuildExtensions/"* "${TARGET_DIR}" echo '::endgroup::' diff --git a/.github/workflows/build-cmake.yml b/.github/workflows/build-cmake.yml index 06bd4de753e..3871dca340f 100644 --- a/.github/workflows/build-cmake.yml +++ b/.github/workflows/build-cmake.yml @@ -74,9 +74,9 @@ jobs: script: | set -euo pipefail - source packaging/windows/internal/vc_install_helper.sh - export PYTHON_VERSION=3.8 + export VC_YEAR=2022 + export VSDEVCMD_ARGS="" export GPU_ARCH_TYPE=${{ matrix.gpu-arch-type }} export GPU_ARCH_VERSION=${{ matrix.gpu-arch-version }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cd6011b4ad4..22e1a4ac18d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -98,6 +98,8 @@ jobs: set -euxo pipefail export PYTHON_VERSION=${{ matrix.python-version }} + export VC_YEAR=2019 + export VSDEVCMD_ARGS="" export GPU_ARCH_TYPE=${{ matrix.gpu-arch-type }} export GPU_ARCH_VERSION=${{ matrix.gpu-arch-version }} diff --git a/packaging/windows/internal/vc_env_helper.bat b/packaging/windows/internal/vc_env_helper.bat index e85a372f93d..d3484a66e9f 100644 --- a/packaging/windows/internal/vc_env_helper.bat +++ b/packaging/windows/internal/vc_env_helper.bat @@ -1,7 +1,11 @@ @echo on -set VC_VERSION_LOWER=16 -set VC_VERSION_UPPER=17 +set VC_VERSION_LOWER=17 +set VC_VERSION_UPPER=18 +if "%VC_YEAR%" == "2019" ( + set VC_VERSION_LOWER=16 + set VC_VERSION_UPPER=17 +) if "%VC_YEAR%" == "2017" ( set VC_VERSION_LOWER=15 set VC_VERSION_UPPER=16 diff --git a/packaging/windows/internal/vc_install_helper.sh b/packaging/windows/internal/vc_install_helper.sh deleted file mode 100644 index 251509ae194..00000000000 --- a/packaging/windows/internal/vc_install_helper.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -ex - -export VC_YEAR=2019 -export VSDEVCMD_ARGS=""