Skip to content

Commit

Permalink
Fix MSVC version
Browse files Browse the repository at this point in the history
  • Loading branch information
complexlogic committed Sep 14, 2023
1 parent 99c7e75 commit 3b6affb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,43 @@ jobs:
repository: complexlogic/vcpkg
ref: refs/heads/rsgain
path: build/overlays
- name: Remove Old VS version (Hack)
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$componentsToRemove= @(
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM64"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM64.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.x86.x64"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.x86.x64.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM64"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM64.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM64"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM64.Spectre"
)
[string]$workloadArgs = $componentsToRemove | ForEach-Object {" --remove " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
# should be run twice
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
- name: Configure
run: cmake -S . -B build
-G "${{env.CMAKE_GENERATOR}}"
-G "${{env.CMAKE_GENERATOR}}"
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_OVERLAY_PORTS=build/overlays/ports
-DVCPKG_OVERLAY_TRIPLETS=config/vcpkg_triplets
-DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TRIPLET}}
-DCMAKE_VS_PLATFORM_TOOLSET_VERSION=14.37

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ include_directories(${PROJECT_BINARY_DIR})
add_compile_definitions("$<$<CONFIG:DEBUG>:DEBUG>")
if (WIN32)
set (USE_STD_FORMAT true)
if (MSVC_VERSION AND MSVC_VERSION VERSION_LESS 17.7)
if (MSVC_VERSION AND MSVC_VERSION VERSION_LESS 1937)
message(FATAL_ERROR "Visual Studio 17.7 and later supported only")
endif ()
endif ()
Expand Down

0 comments on commit 3b6affb

Please sign in to comment.