Browse Source

CI: Use VS2022 and clang-format 13

Switch to Visual Studio 2022 and clang-format 13.

The Ubuntu 22.04 image currently has clang-format 12.0.1, 13.0.1, and
14.0.0. VS2022 17.2 ships clang-format 13.0.1, so let's use that for now
until VS2022 17.3 is available with clang-format 14.

This commit also makes the necessary changes to allow the clang-format
check to pass.

This commit also updates the obs-browser submodules with the necessary
changes.
Ryan Foster 3 years ago
parent
commit
81bd1d42f0

+ 2 - 2
.github/workflows/clang-format.yml

@@ -10,7 +10,7 @@ on:
 
 jobs:
   clang-format-check:
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-22.04
     steps:
       - name: Checkout
         uses: actions/checkout@v3
@@ -19,7 +19,7 @@ jobs:
 
       - name: Install clang format
         run: |
-          sudo apt-get install -y clang-format-12
+          sudo apt-get install -y clang-format-13
 
       - name: 'Run clang-format'
         run: |

+ 4 - 4
.github/workflows/main.yml

@@ -42,7 +42,7 @@ env:
 jobs:
   clang_check:
     name: '01 - Code Format Check'
-    runs-on: [ubuntu-latest]
+    runs-on: [ubuntu-22.04]
     steps:
       - name: 'Checkout'
         uses: actions/checkout@v3
@@ -50,7 +50,7 @@ jobs:
           submodules: 'recursive'
 
       - name: 'Install clang-format'
-        run: sudo apt-get install -y clang-format-12
+        run: sudo apt-get install -y clang-format-13
 
       - name: 'Run clang-format'
         run: |
@@ -280,14 +280,14 @@ jobs:
 
   windows_build:
     name: '02 - Windows'
-    runs-on: [windows-2019]
+    runs-on: [windows-2022]
     needs: [clang_check]
     if: always()
     strategy:
       matrix:
         arch: [x64, x86]
     env:
-      CMAKE_GENERATOR: 'Visual Studio 16 2019'
+      CMAKE_GENERATOR: 'Visual Studio 17 2022'
       CMAKE_SYSTEM_VERSION: '10.0.18363.657'
       VIRTUALCAM-GUID: 'A3FCE0F5-3493-419F-958A-ABA1250EC20B'
       BUILD_FOR_DISTRIBUTION: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}

+ 5 - 5
CI/check-format.sh

@@ -26,18 +26,18 @@ elif [[ ${OS} = "Darwin" ]] ; then
 fi
 
 # Discover clang-format
-if type clang-format-12 2> /dev/null ; then
-    CLANG_FORMAT=clang-format-12
+if type clang-format-13 2> /dev/null ; then
+    CLANG_FORMAT=clang-format-13
 elif type clang-format 2> /dev/null ; then
     # Clang format found, but need to check version
     CLANG_FORMAT=clang-format
     V=$(clang-format --version)
-    if [[ $V != *"version 12.0"* ]]; then
-        echo "clang-format is not 12.0 (returned ${V})"
+    if [[ $V != *"version 13.0"* ]]; then
+        echo "clang-format is not 13.0 (returned ${V})"
         exit 1
     fi
 else
-    echo "No appropriate clang-format found (expected clang-format-12.0.0, or clang-format)"
+    echo "No appropriate clang-format found (expected clang-format-13.0.0, or clang-format)"
     exit 1
 fi
 

+ 4 - 4
UI/window-basic-main-transitions.cpp

@@ -1013,7 +1013,7 @@ QMenu *OBSBasic::CreatePerSceneTransitionMenu()
 		obs_data_set_int(data, "transition_duration", duration);
 	};
 
-	connect(duration, (void (QSpinBox::*)(int)) & QSpinBox::valueChanged,
+	connect(duration, (void(QSpinBox::*)(int)) & QSpinBox::valueChanged,
 		setDuration);
 
 	for (int i = -1; i < ui->transitions->count(); i++) {
@@ -1214,7 +1214,7 @@ QMenu *OBSBasic::CreateVisibilityTransitionMenu(bool visible)
 		OBSSceneItem item = main->GetCurrentSceneItem();
 		obs_sceneitem_set_transition_duration(item, visible, duration);
 	};
-	connect(duration, (void (QSpinBox::*)(int)) & QSpinBox::valueChanged,
+	connect(duration, (void(QSpinBox::*)(int)) & QSpinBox::valueChanged,
 		setDuration);
 
 	action = menu->addAction(QT_UTF8(Str("None")));
@@ -1312,8 +1312,8 @@ QMenu *OBSBasic::CreateTransitionMenu(QWidget *parent, QuickTransition *qt)
 
 	if (qt) {
 		connect(duration,
-			(void (QSpinBox::*)(int)) & QSpinBox::valueChanged,
-			this, &OBSBasic::QuickTransitionChangeDuration);
+			(void(QSpinBox::*)(int)) & QSpinBox::valueChanged, this,
+			&OBSBasic::QuickTransitionChangeDuration);
 	}
 
 	tr = fadeTransition;

+ 1 - 1
plugins/obs-browser

@@ -1 +1 @@
-Subproject commit 6c44455887a71094a0b4253421461e4326806b10
+Subproject commit 39517c9ea0716ab6fa7c325514ea6bea808165f7