Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cd01349
libobs-metal: Add opt-outs for swift-format lints
PatTheMav Jun 19, 2026
6953601
libobs-metal: Fix swift-format issues
PatTheMav Jun 23, 2026
d3595cd
plugins: Fix swift-format issues in virtualcam
PatTheMav Jul 23, 2026
0cc39e7
cmake: Update formatting for gersemi 0.28.0
PatTheMav Aug 1, 2026
cce7d6a
build-aux: Update formatter script
PatTheMav Jun 22, 2026
401700d
CI: Update format check actions
PatTheMav Aug 2, 2026
2bd8742
cmake: Fix Xcode warning of duplicate copy steps
PatTheMav Jul 24, 2026
5e78058
cmake: Enable Xcode compilation caching by default
PatTheMav Jun 23, 2026
5885763
cmake: Fix sub-project locations on Windows
PatTheMav Aug 1, 2026
55e98b8
cmake: Fix use of potentially undeclared variables
PatTheMav Aug 1, 2026
c241025
cmake: Fix use of PRE_BUILD in add_custom_command
PatTheMav Aug 1, 2026
d6e976e
cmake: Add application category for macOS
PatTheMav Aug 1, 2026
6403830
cmake: Switch AUTHOR_WARNING to WARNING
PatTheMav Aug 1, 2026
3290c3f
cmake: Add policy to switch CMP0200 to NEW
PatTheMav Aug 1, 2026
70b81b7
cmake: Switch pre-release message to STATUS
PatTheMav Aug 1, 2026
b52b87f
cmake: Remove superfluous formatting
PatTheMav Aug 1, 2026
640bb32
cmake: Fix version detection for sparse checkouts
PatTheMav Aug 1, 2026
0c17784
cmake: Elevate warnings to errors on CI only
PatTheMav Aug 1, 2026
0b058e2
cmake: Temporarily downgrade MbedTLS warning
PatTheMav Aug 1, 2026
6411eed
cmake: Remove global policy include
PatTheMav Aug 4, 2026
bcfacae
cmake: Enforce policies in CMakePresets file
PatTheMav Aug 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/actions/run-clang-format/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ runs:
working-directory: ${{ inputs.workingDirectory }}
env:
CHANGED_FILES: ${{ steps.checks.outputs.changedFiles }}
FAIL_MODE: ${{ inputs.failCondition }}
run: |
: Run clang-format 🐉
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
Expand All @@ -59,5 +60,11 @@ runs:

print ::group::Run clang-format-22
local -a changes=(${(s:,:)CHANGED_FILES//[\[\]\'\"]/})
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes}

if [[ "${FAIL_MODE:-never}" == 'never' ]] {
setopt NO_ERR_EXIT
setopt NO_ERR_RETURN
}

./build-aux/run-clang-format --check --github ${changes}
print ::endgroup::
11 changes: 8 additions & 3 deletions .github/actions/run-gersemi/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,22 @@ runs:
working-directory: ${{ github.workspace }}
env:
CHANGED_FILES: ${{ steps.checks.outputs.changedFiles }}
FAIL_MODE: ${{ inputs.failCondition }}
run: |
: Run gersemi 🎛️
if (( ${+RUNNER_DEBUG} )) setopt XTRACE

print ::group::Install gersemi
brew update
brew trust obsproject/tools
brew install --quiet obsproject/tools/gersemi@0.25
brew install --quiet gersemi
print ::endgroup::

if [[ "${FAIL_MODE:-never}" == 'never' ]] {
setopt NO_ERR_EXIT
setopt NO_ERR_RETURN
}

print ::group::Run gersemi
local -a changes=(${(s:,:)CHANGED_FILES//[\[\]\'\"]/})
./build-aux/run-gersemi --fail-${{ inputs.failCondition }} --check ${changes}
./build-aux/run-gersemi --check --github ${changes}
print ::endgroup::
8 changes: 7 additions & 1 deletion .github/actions/run-swift-format/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ runs:
working-directory: ${{ github.workspace }}
env:
CHANGED_FILES: ${{ steps.checks.outputs.changedFiles }}
FAIL_MODE: ${{ inputs.failCondition }}
run: |
: Run swift-format 🔥
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
Expand All @@ -55,7 +56,12 @@ runs:
brew install --quiet swift-format
print ::endgroup::

if [[ "${FAIL_MODE:-never}" == 'never' ]] {
setopt NO_ERR_EXIT
setopt NO_ERR_RETURN
}

print ::group::Run swift-format
local -a changes=(${(s:,:)CHANGED_FILES//[\[\]\'\"]/})
./build-aux/run-swift-format --fail-${{ inputs.failCondition }} --check ${changes}
./build-aux/run-swift-format --check --github ${changes}
print ::endgroup::
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.28...3.30)

include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake" NO_POLICY_SCOPE)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake")

project(obs-studio VERSION ${OBS_VERSION_CANONICAL})

Expand Down
33 changes: 26 additions & 7 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"displayName": "macOS",
"description": "Default macOS build (single architecture only)",
"inherits": ["environmentVars"],
"warnings": {"dev": true, "deprecated": true},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
Expand All @@ -96,6 +97,7 @@
"generator": "Xcode",
"binaryDir": "${sourceDir}/build_macos",
"cacheVariables": {
"CMAKE_XCODE_ATTRIBUTE_COMPILATION_CACHE_ENABLE_CACHING": "YES",
"CMAKE_OSX_DEPLOYMENT_TARGET": {"type": "STRING", "value": "13.0"},
"OBS_CODESIGN_IDENTITY": {"type": "STRING", "value": "$penv{CODESIGN_IDENT}"},
"OBS_CODESIGN_TEAM": {"type": "STRING", "value": "$penv{CODESIGN_TEAM}"},
Expand All @@ -113,11 +115,13 @@
"displayName": "macOS (CI)",
"description": "CI macOS build (single architecture only)",
"inherits": ["macos"],
"warnings": {"dev": true, "deprecated": true},
"errors": {"dev": true, "deprecated": true},
"cacheVariables": {
"CMAKE_COMPILE_WARNING_AS_ERROR": true,
"CMAKE_XCODE_ATTRIBUTE_COMPILATION_CACHE_ENABLE_CACHING": "YES",
"CMAKE_XCODE_ATTRIBUTE_COMPILATION_CACHE_CAS_PATH": "$penv{XCODE_CAS_PATH}"
"CMAKE_POLICY_DEFAULT_CMP0179": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0181": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0199": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0200": "NEW"
}
},
{
Expand Down Expand Up @@ -145,10 +149,15 @@
{
"name": "ubuntu-ci",
"inherits": ["ubuntu"],
"errors": {"dev": true, "deprecated": true},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_COMPILE_WARNING_AS_ERROR": true,
"CMAKE_COLOR_DIAGNOSTICS": true,
"CMAKE_POLICY_DEFAULT_CMP0179": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0181": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0199": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0200": "NEW",
"ENABLE_CCACHE": true
}
},
Expand All @@ -157,6 +166,7 @@
"displayName": "Windows x64",
"description": "Default Windows build (x64)",
"inherits": ["environmentVars"],
"warnings": {"dev": true, "deprecated": true},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
Expand All @@ -176,16 +186,21 @@
"displayName": "Windows x64 (CI)",
"description": "CI Windows build (x64)",
"inherits": ["windows-x64"],
"warnings": {"dev": true, "deprecated": true},
"errors": {"dev": true, "deprecated": true},
"cacheVariables": {
"CMAKE_COMPILE_WARNING_AS_ERROR": true
"CMAKE_COMPILE_WARNING_AS_ERROR": true,
"CMAKE_POLICY_DEFAULT_CMP0179": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0181": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0199": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0200": "NEW"
}
},
{
"name": "windows-arm64",
"displayName": "Windows ARM64",
"description": "Default Windows build (ARM64)",
"inherits": ["environmentVars"],
"warnings": {"dev": true, "deprecated": true},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
Expand All @@ -208,9 +223,13 @@
"displayName": "Windows ARM64 (CI)",
"description": "CI Windows build (ARM64)",
"inherits": ["windows-arm64"],
"warnings": {"dev": true, "deprecated": true},
"errors": {"dev": true, "deprecated": true},
"cacheVariables": {
"CMAKE_COMPILE_WARNING_AS_ERROR": true
"CMAKE_COMPILE_WARNING_AS_ERROR": true,
"CMAKE_POLICY_DEFAULT_CMP0179": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0181": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0199": "NEW",
"CMAKE_POLICY_DEFAULT_CMP0200": "NEW"
}
}
],
Expand Down
38 changes: 38 additions & 0 deletions build-aux/.run-format-launcher
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env sh

# Combined POSIX Csh/Powershell entry point script
# Based on StackOverflow answer by Jeff Hykin
# https://stackoverflow.com/a/67292076
#
# In Csh the first line will echo "--%" to /dev/null, followed by the colon built-in
# (using the semi-colon to create a command list). This built-in does nothing apart
# from variable expansions, and is given a multi-line string.
#
# In Powershell the line uses the '--%' token to stop parsing, which will also send the
# 'echo'. output to Powershell's null output, and will then encounter the declaration
# of a multiline comment, which extends until after the "exit" command.
#
# Thus Powershell will execute the code below "exit" in earnest, whereas Csh will ignore
# anything past that "exit".
#

echo --% >/dev/null;: ' | out-null
<#'
host_os="$(uname)"
script_location="$(dirname "${0}")"
linter_name="$(basename "${0}")"
linter_name="${linter_name#*-}"

if [ "${host_os}" = 'Darwin' ]; then
exec zsh "${script_location}/.run-format.zsh" --linter "${linter_name}" "${@}"
elif command -v zsh > /dev/null; then
exec zsh "${script_location}/.run-format.zsh" --linter "${linter_name}" "${@}"
else
exec bash "${script_location}/.run-format.bash" --linter "${linter_name}" "${@}"
fi
exit #>

$ScriptLocation = $PSScriptRoot
$LinterName = ($MyInvocation.MyCommand.Name) -replace 'run-(.+).ps1','$1'

. ${ScriptLocation}/.run-format.ps1 -Linter "${LinterName}" @Args
Loading
Loading