Skip to content

Commit 602c338

Browse files
committed
Update build scripts to latest obs-plugintemplate
This is a wholesale replacement of the build infrastructure with the latest version from https://github.com/obsproject/obs-plugintemplate. The new build baseline is now on commit 013ffca, "cmake: Fix default installation directory for Windows" This commit disables UART camera control because QSerialPort is not available in the prebuild OBS libraries, and it also disables joystick support because SDL needs to be ported over into the new build infrastructure. At least this commit gets the plugin building again and working with a recent OBS Studio release. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
1 parent 52a9e79 commit 602c338

File tree

117 files changed

+4385
-3723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+4385
-3723
lines changed

.clang-format

Lines changed: 118 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# please use clang-format version 8 or later
1+
# please use clang-format version 16 or later
22

3-
Standard: Cpp11
3+
Standard: c++17
44
AccessModifierOffset: -8
55
AlignAfterOpenBracket: Align
66
AlignConsecutiveAssignments: false
77
AlignConsecutiveDeclarations: false
88
AlignEscapedNewlines: Left
99
AlignOperands: true
1010
AlignTrailingComments: true
11-
#AllowAllArgumentsOnNextLine: false # requires clang-format 9
12-
#AllowAllConstructorInitializersOnNextLine: false # requires clang-format 9
11+
AllowAllArgumentsOnNextLine: false
12+
AllowAllConstructorInitializersOnNextLine: false
1313
AllowAllParametersOfDeclarationOnNextLine: false
1414
AllowShortBlocksOnASingleLine: false
1515
AllowShortCaseLabelsOnASingleLine: false
1616
AllowShortFunctionsOnASingleLine: Inline
1717
AllowShortIfStatementsOnASingleLine: false
18-
#AllowShortLambdasOnASingleLine: Inline # requires clang-format 9
18+
AllowShortLambdasOnASingleLine: Inline
1919
AllowShortLoopsOnASingleLine: false
2020
AlwaysBreakAfterDefinitionReturnType: None
2121
AlwaysBreakAfterReturnType: None
@@ -44,19 +44,20 @@ BreakBeforeBraces: Custom
4444
BreakBeforeTernaryOperators: true
4545
BreakConstructorInitializers: BeforeColon
4646
BreakStringLiterals: false # apparently unpredictable
47-
ColumnLimit: 80
47+
ColumnLimit: 120
4848
CompactNamespaces: false
4949
ConstructorInitializerAllOnOneLineOrOnePerLine: true
5050
ConstructorInitializerIndentWidth: 8
5151
ContinuationIndentWidth: 8
5252
Cpp11BracedListStyle: true
5353
DerivePointerAlignment: false
5454
DisableFormat: false
55-
FixNamespaceComments: false
56-
ForEachMacros:
55+
FixNamespaceComments: true
56+
ForEachMacros:
5757
- 'json_object_foreach'
5858
- 'json_object_foreach_safe'
5959
- 'json_array_foreach'
60+
- 'HASH_ITER'
6061
IncludeBlocks: Preserve
6162
IndentCaseLabels: false
6263
IndentPPDirectives: None
@@ -65,7 +66,7 @@ IndentWrappedFunctionNames: false
6566
KeepEmptyLinesAtTheStartOfBlocks: true
6667
MaxEmptyLinesToKeep: 1
6768
NamespaceIndentation: None
68-
#ObjCBinPackProtocolList: Auto # requires clang-format 7
69+
ObjCBinPackProtocolList: Auto
6970
ObjCBlockIndentWidth: 8
7071
ObjCSpaceAfterProperty: true
7172
ObjCSpaceBeforeProtocolList: true
@@ -83,25 +84,125 @@ ReflowComments: false
8384
SortIncludes: false
8485
SortUsingDeclarations: false
8586
SpaceAfterCStyleCast: false
86-
#SpaceAfterLogicalNot: false # requires clang-format 9
87+
SpaceAfterLogicalNot: false
8788
SpaceAfterTemplateKeyword: false
8889
SpaceBeforeAssignmentOperators: true
89-
#SpaceBeforeCtorInitializerColon: true # requires clang-format 7
90-
#SpaceBeforeInheritanceColon: true # requires clang-format 7
90+
SpaceBeforeCtorInitializerColon: true
91+
SpaceBeforeInheritanceColon: true
9192
SpaceBeforeParens: ControlStatements
92-
#SpaceBeforeRangeBasedForLoopColon: true # requires clang-format 7
93+
SpaceBeforeRangeBasedForLoopColon: true
9394
SpaceInEmptyParentheses: false
9495
SpacesBeforeTrailingComments: 1
9596
SpacesInAngles: false
9697
SpacesInCStyleCastParentheses: false
9798
SpacesInContainerLiterals: false
9899
SpacesInParentheses: false
99100
SpacesInSquareBrackets: false
100-
#StatementMacros: # requires clang-format 8
101-
# - 'Q_OBJECT'
101+
StatementMacros:
102+
- 'Q_OBJECT'
102103
TabWidth: 8
103-
#TypenameMacros: # requires clang-format 9
104-
# - 'DARRAY'
104+
TypenameMacros:
105+
- 'DARRAY'
105106
UseTab: ForContinuationAndIndentation
106107
---
107108
Language: ObjC
109+
AccessModifierOffset: 2
110+
AlignArrayOfStructures: Right
111+
AlignConsecutiveAssignments: None
112+
AlignConsecutiveBitFields: None
113+
AlignConsecutiveDeclarations: None
114+
AlignConsecutiveMacros:
115+
Enabled: true
116+
AcrossEmptyLines: false
117+
AcrossComments: true
118+
AllowShortBlocksOnASingleLine: Never
119+
AllowShortEnumsOnASingleLine: false
120+
AllowShortFunctionsOnASingleLine: Empty
121+
AllowShortIfStatementsOnASingleLine: Never
122+
AllowShortLambdasOnASingleLine: None
123+
AttributeMacros: ['__unused', '__autoreleasing', '_Nonnull', '__bridge']
124+
BitFieldColonSpacing: Both
125+
#BreakBeforeBraces: Webkit
126+
BreakBeforeBraces: Custom
127+
BraceWrapping:
128+
AfterCaseLabel: false
129+
AfterClass: true
130+
AfterControlStatement: Never
131+
AfterEnum: false
132+
AfterFunction: true
133+
AfterNamespace: false
134+
AfterObjCDeclaration: false
135+
AfterStruct: false
136+
AfterUnion: false
137+
AfterExternBlock: false
138+
BeforeCatch: false
139+
BeforeElse: false
140+
BeforeLambdaBody: false
141+
BeforeWhile: false
142+
IndentBraces: false
143+
SplitEmptyFunction: false
144+
SplitEmptyRecord: false
145+
SplitEmptyNamespace: true
146+
BreakAfterAttributes: Never
147+
BreakArrays: false
148+
BreakBeforeConceptDeclarations: Allowed
149+
BreakBeforeInlineASMColon: OnlyMultiline
150+
BreakConstructorInitializers: AfterColon
151+
BreakInheritanceList: AfterComma
152+
ColumnLimit: 120
153+
ConstructorInitializerIndentWidth: 4
154+
ContinuationIndentWidth: 4
155+
EmptyLineAfterAccessModifier: Never
156+
EmptyLineBeforeAccessModifier: LogicalBlock
157+
ExperimentalAutoDetectBinPacking: false
158+
FixNamespaceComments: true
159+
IndentAccessModifiers: false
160+
IndentCaseBlocks: false
161+
IndentCaseLabels: true
162+
IndentExternBlock: Indent
163+
IndentGotoLabels: false
164+
IndentRequiresClause: true
165+
IndentWidth: 4
166+
IndentWrappedFunctionNames: true
167+
InsertBraces: false
168+
InsertNewlineAtEOF: true
169+
KeepEmptyLinesAtTheStartOfBlocks: false
170+
LambdaBodyIndentation: Signature
171+
NamespaceIndentation: All
172+
ObjCBinPackProtocolList: Auto
173+
ObjCBlockIndentWidth: 4
174+
ObjCBreakBeforeNestedBlockParam: false
175+
ObjCSpaceAfterProperty: true
176+
ObjCSpaceBeforeProtocolList: true
177+
PPIndentWidth: -1
178+
PackConstructorInitializers: NextLine
179+
QualifierAlignment: Leave
180+
ReferenceAlignment: Right
181+
RemoveSemicolon: false
182+
RequiresClausePosition: WithPreceding
183+
RequiresExpressionIndentation: OuterScope
184+
SeparateDefinitionBlocks: Always
185+
ShortNamespaceLines: 1
186+
SortIncludes: false
187+
#SortUsingDeclarations: LexicographicNumeric
188+
SortUsingDeclarations: true
189+
SpaceAfterCStyleCast: true
190+
SpaceAfterLogicalNot: false
191+
SpaceAroundPointerQualifiers: Default
192+
SpaceBeforeCaseColon: false
193+
SpaceBeforeCpp11BracedList: true
194+
SpaceBeforeCtorInitializerColon: true
195+
SpaceBeforeInheritanceColon: true
196+
SpaceBeforeParens: ControlStatements
197+
SpaceBeforeRangeBasedForLoopColon: true
198+
SpaceBeforeSquareBrackets: false
199+
SpaceInEmptyBlock: false
200+
SpaceInEmptyParentheses: false
201+
SpacesBeforeTrailingComments: 2
202+
SpacesInConditionalStatement: false
203+
SpacesInLineCommentPrefix:
204+
Minimum: 1
205+
Maximum: -1
206+
Standard: c++17
207+
TabWidth: 4
208+
UseTab: Never

.cmake-format.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

.gersemirc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/master/gersemi/configuration.schema.json
2+
3+
color: false
4+
definitions: []
5+
line_length: 120
6+
indent: 2
7+
list_expansion: favour-inlining
8+
quiet: false
9+
unsafe: false
10+
workers: 10
11+
warn_about_unknown_commands: false
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Set up and build plugin
2+
description: Builds the plugin for specified architecture and build config
3+
inputs:
4+
target:
5+
description: Target architecture for dependencies
6+
required: true
7+
config:
8+
description: Build configuration
9+
required: false
10+
default: RelWithDebInfo
11+
codesign:
12+
description: Enable codesigning (macOS only)
13+
required: false
14+
default: 'false'
15+
codesignIdent:
16+
description: Developer ID for application codesigning (macOS only)
17+
required: false
18+
default: '-'
19+
workingDirectory:
20+
description: Working directory for packaging
21+
required: false
22+
default: ${{ github.workspace }}
23+
runs:
24+
using: composite
25+
steps:
26+
- name: Run macOS Build
27+
if: runner.os == 'macOS'
28+
shell: zsh --no-rcs --errexit --pipefail {0}
29+
working-directory: ${{ inputs.workingDirectory }}
30+
env:
31+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
32+
CODESIGN_IDENT: ${{ inputs.codesignIdent }}
33+
CODESIGN_TEAM: ${{ inputs.codesignTeam }}
34+
run: |
35+
: Run macOS Build
36+
37+
local -a build_args=(--config ${{ inputs.config }})
38+
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
39+
40+
if [[ '${{ inputs.codesign }}' == 'true' ]] build_args+=(--codesign)
41+
42+
.github/scripts/build-macos ${build_args}
43+
44+
- name: Install Dependencies 🛍️
45+
if: runner.os == 'Linux'
46+
shell: bash
47+
run: |
48+
: Install Dependencies 🛍️
49+
echo ::group::Install Dependencies
50+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
51+
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
52+
brew install --quiet zsh
53+
echo ::endgroup::
54+
55+
- name: Run Ubuntu Build
56+
if: runner.os == 'Linux'
57+
shell: zsh --no-rcs --errexit --pipefail {0}
58+
working-directory: ${{ inputs.workingDirectory }}
59+
env:
60+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
61+
run: |
62+
: Run Ubuntu Build
63+
64+
local -a build_args=(
65+
--target ubuntu-${{ inputs.target }}
66+
--config ${{ inputs.config }}
67+
)
68+
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
69+
70+
.github/scripts/build-ubuntu ${build_args}
71+
72+
- name: Run Windows Build
73+
if: runner.os == 'Windows'
74+
shell: pwsh
75+
run: |
76+
# Run Windows Build
77+
if ( $Env:RUNNER_DEBUG -ne $null ) {
78+
Set-PSDebug -Trace 1
79+
}
80+
81+
$BuildArgs = @{
82+
Target = '${{ inputs.target }}'
83+
Configuration = '${{ inputs.config }}'
84+
}
85+
86+
.github/scripts/Build-Windows.ps1 @BuildArgs
87+
88+
- name: Create Summary 📊
89+
if: contains(fromJSON('["Linux", "macOS"]'),runner.os)
90+
shell: zsh --no-rcs --errexit --pipefail {0}
91+
env:
92+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
93+
run: |
94+
: Create Summary 📊
95+
96+
local -a ccache_data
97+
if (( ${+RUNNER_DEBUG} )) {
98+
setopt XTRACE
99+
ccache_data=("${(fA)$(ccache -s -vv)}")
100+
} else {
101+
ccache_data=("${(fA)$(ccache -s)}")
102+
}
103+
104+
print '### ${{ runner.os }} Ccache Stats (${{ inputs.target }})' >> $GITHUB_STEP_SUMMARY
105+
print '```' >> $GITHUB_STEP_SUMMARY
106+
for line (${ccache_data}) {
107+
print ${line} >> $GITHUB_STEP_SUMMARY
108+
}
109+
print '```' >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)