Skip to content

Commit

Permalink
Update template
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirdEyeSqueegee committed Sep 13, 2023
1 parent 6bb542d commit 1691a8f
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 59 deletions.
83 changes: 37 additions & 46 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
BasedOnStyle: Microsoft
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignArrayOfStructures: Left
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
Expand All @@ -27,7 +27,7 @@ AlignConsecutiveMacros:
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignEscapedNewlines: Left
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments:
Kind: Always
Expand All @@ -37,13 +37,14 @@ AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros:
- __declspec
- __try
Expand All @@ -58,33 +59,33 @@ BraceWrapping:
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterExternBlock: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: false
AfterExternBlock: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakAfterJavaFieldAnnotations: false
BreakArrays: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Custom
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 150
CommentPragmas: "^ IWYU pragma:"
ColumnLimit: 0
CommentPragmas: ""
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Expand All @@ -95,13 +96,11 @@ EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
IncludeBlocks: Preserve
ForEachMacros:
IfMacros:
IncludeBlocks: Regroup
IncludeCategories:
- Regex: .*
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: (Test)?$
IncludeIsMainRegex: ""
IncludeIsMainSourceRegex: ""
IndentAccessModifiers: false
IndentCaseBlocks: false
Expand All @@ -126,38 +125,39 @@ JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
Language: Cpp
LineEnding: CRLF
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
NamespaceMacros:
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PPIndentWidth: -1
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakAssignment: 0
PenaltyBreakBeforeFirstCallParameter: 0
PenaltyBreakComment: 0
PenaltyBreakFirstLessLess: 0
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyBreakString: 0
PenaltyBreakTemplateDeclaration: 0
PenaltyExcessCharacter: 0
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 1000
PenaltyReturnTypeOnItsOwnLine: 0
PointerAlignment: Left
QualifierAlignment: Custom
PPIndentWidth: -1
QualifierAlignment: Leave
RawStringFormats:
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Always
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
Expand All @@ -175,8 +175,8 @@ SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDeclarationName: false
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: false
Expand All @@ -185,27 +185,18 @@ SpaceBeforeParensOptions:
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
StatementAttributeLikeMacros:
StatementMacros:
TabWidth: 4
TypenameMacros:
UseTab: Never
QualifierOrder:
- inline
- static
- constexpr
- const
- volatile
- friend
- restrict
- type
LineEnding: CRLF
WhitespaceSensitiveMacros:
---
3 changes: 1 addition & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
uses: EndBug/[email protected]
with:
message: "ci: formatting"
committer_name: maintenance
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
default_author: github_actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 18 additions & 10 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,33 @@
"name": "base",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_FLAGS": "$env{COMMONLIBSF_COMPILER} $env{COMMONLIBSF_PLATFORM} $env{COMMONLIBSF_TEXT}",
"CMAKE_SHARED_LINKER_FLAGS": "$env{COMMONLIBSF_LINKER}"
"CMAKE_CXX_FLAGS": "$env{COMMONLIBSSE_COMPILER} $env{COMMONLIBSSE_PLATFORM} $env{COMMONLIBSSE_TEXT}",
"CMAKE_SHARED_LINKER_FLAGS": "$env{COMMONLIBSSE_LINKER}"
}
},
{
"name": "vcpkg",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "x64-windows",
"VCPKG_HOST_TRIPLET": "x64-windows",
"VCPKG_TARGET_TRIPLET": "x64-windows-skse",
"VCPKG_HOST_TRIPLET": "x64-windows-skse",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake"
}
},
{
"name": "win32",
"hidden": true,
"environment": {
"COMMONLIBSF_PLATFORM": "-DWIN32_LEAN_AND_MEAN -DNOMINMAX"
"COMMONLIBSSE_PLATFORM": "-DWIN32_LEAN_AND_MEAN -DNOMINMAX"
}
},
{
"name": "win32-unicode",
"hidden": true,
"inherits": "win32",
"environment": {
"COMMONLIBSSE_TEXT": "-DUNICODE -D_UNICODE"
}
},
{
Expand All @@ -45,11 +53,11 @@
"generator": "Ninja",
"cmakeExecutable": "C:/Program Files/CMake/bin/",
"environment": {
"COMMONLIBSF_COMPILER": "/cgthreads8 /diagnostics:caret /EHsc /fp:contract /fp:except- /guard:cf- /MP /permissive- /sdl /W4 /Zc:__cplusplus /Zc:enumTypes /Zc:lambda /Zc:preprocessor /Zc:referenceBinding /Zc:rvalueCast /Zc:templateScope /Zc:ternary",
"COMMONLIBSF_LINKER": "/CGTHREADS:8 /MACHINE:x64 /DEBUG:FULL"
"COMMONLIBSSE_COMPILER": "/cgthreads8 /diagnostics:caret /EHsc /fp:contract /fp:except- /guard:cf- /MP /permissive- /sdl /W4 /Zc:__cplusplus /Zc:enumTypes /Zc:lambda /Zc:preprocessor /Zc:referenceBinding /Zc:rvalueCast /Zc:templateScope /Zc:ternary",
"COMMONLIBSSE_LINKER": "/CGTHREADS:8 /MACHINE:x64 /DEBUG:FULL"
},
"cacheVariables": {
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "/fp:fast /GL /GR- /Gw /O2 /Ob3 /Qpar /MD",
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "/fp:fast /GL /GR- /Gw /O2 /Ob3 /Qpar /Qvec",
"CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO": "/LTCG:INCREMENTAL /OPT:REF,ICF=4",
"CMAKE_CXX_FLAGS_DEBUG": "/Od /MDd",
"CMAKE_SHARED_LINKER_FLAGS_DEBUG": "/DEBUGTYPE:FIXUP"
Expand All @@ -64,7 +72,7 @@
},
{
"name": "build-release-msvc",
"inherits": ["base", "vcpkg", "x64", "msvc"],
"inherits": ["base", "vcpkg", "win32-unicode", "x64", "msvc"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
Expand All @@ -74,7 +82,7 @@
},
{
"name": "build-debug-msvc",
"inherits": ["base", "vcpkg", "x64", "msvc"],
"inherits": ["base", "vcpkg", "win32-unicode", "x64", "msvc"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
},
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Setup

### Manual

1. Clone the repository
2. Set the `"name"` and `"version-semver"` fields in `vcpkg.json`
3. Update the `"baseline"` entries to the latest commits in both registries in `vcpkg.json`
Expand All @@ -11,6 +13,8 @@
6. Set the name of `contrib/Config/PluginName.ini` to the name of your plugin
7. Edit the `ini.LoadFile()` call in `src/Settings.cpp` to load the renamed ini from step 6

### Automatic

A python script, `project_setup.py`, is provided which automates the above steps (requires [Python 3.12+](https://www.python.org/download/pre-releases/)). To run the script:

1. Run `cd .\CLibSFPluginTemplate\`
Expand All @@ -35,4 +39,4 @@ A python script, `project_setup.py`, is provided which automates the above steps
- Create a new Windows environment variable called `VCPKG_ROOT` which points to your vcpkg install directory
- [CMake v3.27+](https://cmake.org/)
- [LLVM v16.0.6+](https://github.com/llvm/llvm-project/releases)
- Visual Studio 2022 with C++ workload
- [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) with C++ workload

0 comments on commit 1691a8f

Please sign in to comment.