Skip to content

Commit

Permalink
Project: Resume work on engine, lots of changes
Browse files Browse the repository at this point in the history
Back on the grind, lots was changed to work with latest C++20 modules improvements and C++23 features.

Developing this was done on clang-18 + libc++, GCC isn't there just yet and libc++ provided better support for fancy things.

- Thread class was mostly rewritten to be simpler, mutex-less and to be consistent.
- Migrated from vcpkg to CPM, vcpkg was causing way too many issues and CPM is essentially a wrapper around FetchContent which I like.
- ThreadPool was removed completely, once C++'s <execution> becomes more widely available, I feel we can make Thread class do it all.
- Logging now uses <print>, neat little thing!
  • Loading branch information
DatCaptainHorse committed Mar 30, 2024
1 parent 5211f68 commit bebdbc5
Show file tree
Hide file tree
Showing 24 changed files with 1,704 additions and 713 deletions.
78 changes: 17 additions & 61 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,65 +1,21 @@
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignOperands: Align
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
# Give us some space
ColumnLimit: 100
CompactNamespaces: false
ContinuationIndentWidth: 8
IndentCaseLabels: true
IndentPPDirectives: AfterHash
# Don't change our includes (order matters!)
SortIncludes: Never
# Tabs please! - With 4-space width
UseTab: Always
TabWidth: 4
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 2
AccessModifierOffset: -4
# Indents in namespaces
NamespaceIndentation: All
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Always
PackConstructorInitializers: BinPack
# Newline after template
AlwaysBreakTemplateDeclarations: Yes
# Don't indent "requires" lines
IndentRequiresClause: false
# Allow single while loops without braces
AllowShortLoopsOnASingleLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: WithoutElse
11 changes: 2 additions & 9 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
Checks: '-*,
bugprone-*,
cppcoreguidelines-*
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-prefer-member-initializer,
modernize-*,
mpi-*,
portability-*,
performance-*,
readability-*,
-readability-identifier-length,
misc-*,
-readability-magic-numbers,
-readability-braces-around-statements'
performance-*'

WarningsAsErrors: '*'
13 changes: 4 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
paths-ignore: [ "**.md" ]
branches: [ "master", "release/**" ]

env:
BUILD_TYPE: Release

jobs:
windows_build:
name: "Build - Windows (MSVC)"
Expand All @@ -16,24 +19,16 @@ jobs:
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: "Setup MSBuild"
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v2
with:
vs-prerelease: true
msbuild-architecture: x64

- name: "Setup CMake"
uses: lukka/get-cmake@latest

- name: "Run vcpkg"
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: "vcpkg.json"

- name: "Run CMake"
uses: lukka/run-cmake@v10
with:
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

Loading

0 comments on commit bebdbc5

Please sign in to comment.