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 64b7725
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
46 changes: 40 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ on:

workflow_dispatch:

defaults:
run:
shell: bash

permissions:
actions: none
checks: none
Expand All @@ -28,6 +24,9 @@ permissions:
repository-projects: none
security-events: none
statuses: read
defaults:
run:
shell: bash

env:
VCPKG_COMMITTISH: 962e5e39f8a25f42522f51fffc574e05a3efd26b
Expand All @@ -45,10 +44,42 @@ jobs:
VCPKG_TRIPLET: custom-triplet

steps:
- name: Remove Old VS version (Hack)
shell: pwsh
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: Checkout Git repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Setup vcpkg
uses: friendlyanon/setup-vcpkg@v1
Expand All @@ -64,12 +95,11 @@ jobs:

- 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 Expand Up @@ -121,6 +151,8 @@ jobs:
steps:
- name: Checkout Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Install dependencies"
run: |
Expand Down Expand Up @@ -181,6 +213,8 @@ jobs:
steps:
- name: Checkout Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Install dependencies"
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
4 changes: 2 additions & 2 deletions docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ rsgain builds natively on Unix and Windows, and features a cross-platform CMake
- fmt
- inih

The source code is written in C++20, and as such requires a relatively modern compiler to build:
The Windows version uses C++23, and the Unix versions use C++20 with plans to upgrade to C++23 in the future. As such, it requires a relatively modern compiler to build:

- On Windows, use Visual Studio 2022
- On Windows, Visual Studio 2022 17.7 or later is required
- On Linux, use GCC 10 or later
- On macOS, the latest available Xcode for your machine should work

Expand Down

0 comments on commit 64b7725

Please sign in to comment.