This commit is contained in:
358
.clang-format
Normal file
358
.clang-format
Normal file
@@ -0,0 +1,358 @@
|
||||
---
|
||||
Language: Cpp
|
||||
AlignAfterOpenBracket: true
|
||||
AccessModifierOffset: -1
|
||||
AlignArrayOfStructures: None
|
||||
AlignConsecutiveAssignments:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionDeclarations: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: true
|
||||
AlignConsecutiveBitFields:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionDeclarations: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveDeclarations:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionDeclarations: true
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveMacros:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionDeclarations: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveShortCaseStatements:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCaseArrows: false
|
||||
AlignCaseColons: false
|
||||
AlignConsecutiveTableGenBreakingDAGArgColons:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionDeclarations: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveTableGenCondOperatorColons:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionDeclarations: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignConsecutiveTableGenDefinitionColons:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionDeclarations: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: false
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: Align
|
||||
AlignTrailingComments:
|
||||
AlignPPAndNotPP: true
|
||||
Kind: Always
|
||||
OverEmptyLines: 0
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowBreakBeforeNoexceptSpecifier: Never
|
||||
AllowBreakBeforeQtProperty: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseExpressionOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortCompoundRequirementOnASingleLine: true
|
||||
AllowShortEnumsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortLoopsOnASingleLine: true
|
||||
AllowShortNamespacesOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
AttributeMacros:
|
||||
- __capability
|
||||
- absl_nonnull
|
||||
- absl_nullable
|
||||
- absl_nullability_unknown
|
||||
BinPackArguments: true
|
||||
BinPackLongBracedList: true
|
||||
BinPackParameters: BinPack
|
||||
BitFieldColonSpacing: Both
|
||||
BracedInitializerIndentWidth: -1
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: false
|
||||
AfterControlStatement: Never
|
||||
AfterEnum: false
|
||||
AfterExternBlock: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
BreakAdjacentStringLiterals: true
|
||||
BreakAfterAttributes: Leave
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakAfterOpenBracketBracedList: false
|
||||
BreakAfterOpenBracketFunction: false
|
||||
BreakAfterOpenBracketIf: false
|
||||
BreakAfterOpenBracketLoop: false
|
||||
BreakAfterOpenBracketSwitch: false
|
||||
BreakAfterReturnType: None
|
||||
BreakArrays: true
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeCloseBracketBracedList: false
|
||||
BreakBeforeCloseBracketFunction: false
|
||||
BreakBeforeCloseBracketIf: false
|
||||
BreakBeforeCloseBracketLoop: false
|
||||
BreakBeforeCloseBracketSwitch: false
|
||||
BreakBeforeConceptDeclarations: Always
|
||||
BreakBeforeBraces: Attach
|
||||
BreakBeforeInlineASMColon: OnlyMultiline
|
||||
BreakBeforeTemplateCloser: false
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakBinaryOperations: Never
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakFunctionDefinitionParameters: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakStringLiterals: true
|
||||
BreakTemplateDeclarations: Yes
|
||||
ColumnLimit: 80
|
||||
CommentPragmas: "^ IWYU pragma:"
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: AlignFirstComment
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
EmptyLineAfterAccessModifier: Never
|
||||
EmptyLineBeforeAccessModifier: LogicalBlock
|
||||
EnumTrailingComma: Leave
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
FixNamespaceComments: true
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IfMacros:
|
||||
- KJ_IF_MAYBE
|
||||
IncludeBlocks: Regroup
|
||||
IncludeCategories:
|
||||
- Regex: '^<ext/.*\.h>'
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '^<.*\.h>'
|
||||
Priority: 1
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: "^<.*"
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: ".*"
|
||||
Priority: 3
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
IncludeIsMainRegex: "([-_](test|unittest))?$"
|
||||
IncludeIsMainSourceRegex: ""
|
||||
IndentAccessModifiers: false
|
||||
IndentCaseBlocks: false
|
||||
IndentCaseLabels: true
|
||||
IndentExportBlock: true
|
||||
IndentExternBlock: AfterExternBlock
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentRequiresClause: true
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
InsertBraces: false
|
||||
InsertNewlineAtEOF: false
|
||||
InsertTrailingCommas: None
|
||||
IntegerLiteralSeparator:
|
||||
Binary: 0
|
||||
BinaryMinDigitsInsert: 0
|
||||
BinaryMaxDigitsRemove: 0
|
||||
Decimal: 0
|
||||
DecimalMinDigitsInsert: 0
|
||||
DecimalMaxDigitsRemove: 0
|
||||
Hex: 0
|
||||
HexMinDigitsInsert: 0
|
||||
HexMaxDigitsRemove: 0
|
||||
BinaryMinDigits: 0
|
||||
DecimalMinDigits: 0
|
||||
HexMinDigits: 0
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLines:
|
||||
AtEndOfFile: false
|
||||
AtStartOfBlock: false
|
||||
AtStartOfFile: true
|
||||
KeepFormFeed: false
|
||||
LambdaBodyIndentation: Signature
|
||||
LineEnding: DeriveLF
|
||||
MacroBlockBegin: ""
|
||||
MacroBlockEnd: ""
|
||||
MainIncludeChar: Quote
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
NumericLiteralCase:
|
||||
ExponentLetter: Leave
|
||||
HexDigit: Leave
|
||||
Prefix: Leave
|
||||
Suffix: Leave
|
||||
ObjCBinPackProtocolList: Never
|
||||
ObjCBlockIndentWidth: 4
|
||||
ObjCBreakBeforeNestedBlockParam: true
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
OneLineFormatOffRegex: ""
|
||||
PackConstructorInitializers: NextLine
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 1
|
||||
PenaltyBreakBeforeMemberAccess: 150
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakOpenParenthesis: 0
|
||||
PenaltyBreakScopeResolution: 500
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyIndentedWhitespace: 0
|
||||
PenaltyReturnTypeOnItsOwnLine: 200
|
||||
PointerAlignment: Left
|
||||
PPIndentWidth: -1
|
||||
QualifierAlignment: Leave
|
||||
RawStringFormats:
|
||||
- Language: Cpp
|
||||
Delimiters:
|
||||
- cc
|
||||
- CC
|
||||
- cpp
|
||||
- Cpp
|
||||
- CPP
|
||||
- "c++"
|
||||
- "C++"
|
||||
CanonicalDelimiter: ""
|
||||
BasedOnStyle: google
|
||||
- Language: TextProto
|
||||
Delimiters:
|
||||
- pb
|
||||
- PB
|
||||
- proto
|
||||
- PROTO
|
||||
EnclosingFunctions:
|
||||
- EqualsProto
|
||||
- EquivToProto
|
||||
- PARSE_PARTIAL_TEXT_PROTO
|
||||
- PARSE_TEST_PROTO
|
||||
- PARSE_TEXT_PROTO
|
||||
- ParseTextOrDie
|
||||
- ParseTextProtoOrDie
|
||||
- ParseTestProto
|
||||
- ParsePartialTestProto
|
||||
CanonicalDelimiter: pb
|
||||
BasedOnStyle: google
|
||||
ReferenceAlignment: Pointer
|
||||
ReflowComments: Always
|
||||
RemoveBracesLLVM: false
|
||||
RemoveEmptyLinesInUnwrappedLines: false
|
||||
RemoveParentheses: Leave
|
||||
RemoveSemicolon: false
|
||||
RequiresClausePosition: OwnLine
|
||||
RequiresExpressionIndentation: OuterScope
|
||||
SeparateDefinitionBlocks: Leave
|
||||
ShortNamespaceLines: 1
|
||||
SkipMacroDefinitionBody: false
|
||||
SortIncludes:
|
||||
Enabled: true
|
||||
IgnoreCase: false
|
||||
IgnoreExtension: false
|
||||
SortJavaStaticImport: Before
|
||||
SortUsingDeclarations: LexicographicNumeric
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterOperatorKeyword: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceAroundPointerQualifiers: Default
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeJsonColon: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeParensOptions:
|
||||
AfterControlStatements: true
|
||||
AfterForeachMacros: true
|
||||
AfterFunctionDefinitionName: false
|
||||
AfterFunctionDeclarationName: false
|
||||
AfterIfMacros: true
|
||||
AfterNot: false
|
||||
AfterOverloadedOperator: false
|
||||
AfterPlacementOperator: true
|
||||
AfterRequiresInClause: false
|
||||
AfterRequiresInExpression: false
|
||||
BeforeNonEmptyParentheses: false
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceBeforeSquareBrackets: false
|
||||
SpaceInEmptyBraces: Never
|
||||
SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: Never
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInLineCommentPrefix:
|
||||
Minimum: 1
|
||||
Maximum: -1
|
||||
SpacesInParens: Never
|
||||
SpacesInParensOptions:
|
||||
ExceptDoubleParentheses: false
|
||||
InCStyleCasts: false
|
||||
InConditionalStatements: false
|
||||
InEmptyParentheses: false
|
||||
Other: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Auto
|
||||
StatementAttributeLikeMacros:
|
||||
- Q_EMIT
|
||||
StatementMacros:
|
||||
- Q_UNUSED
|
||||
- QT_REQUIRE_VERSION
|
||||
TableGenBreakInsideDAGArg: DontBreak
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
VerilogBreakBetweenInstancePorts: true
|
||||
WhitespaceSensitiveMacros:
|
||||
- BOOST_PP_STRINGIZE
|
||||
- CF_SWIFT_NAME
|
||||
- NS_SWIFT_NAME
|
||||
- PP_STRINGIZE
|
||||
- STRINGIZE
|
||||
WrapNamespaceBodyWithEmptyLines: Leave
|
||||
...
|
||||
|
||||
3
.clangd
Normal file
3
.clangd
Normal file
@@ -0,0 +1,3 @@
|
||||
CompileFlags:
|
||||
Add: -Wno-unknown-warning-option
|
||||
Remove: [-m*, -f*]
|
||||
64
.gitea/workflows/build.yml
Normal file
64
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,64 @@
|
||||
on: [push, pull_request]
|
||||
|
||||
name: Build
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
persist-credentials: true
|
||||
|
||||
- name: Checkout lfs
|
||||
run: |
|
||||
git lfs install --local
|
||||
AUTH=$(git config --local http.${{ github.server_url }}/.extraheader)
|
||||
git config --local --unset http.${{ github.server_url }}/.extraheader
|
||||
git config --local http.${{ github.server_url }}/${{ github.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH"
|
||||
git lfs pull
|
||||
|
||||
- name: Apt update
|
||||
run: sudo apt update
|
||||
|
||||
- name: Installing build chain
|
||||
run: sudo apt-get install pigz ninja-build g++ clang pkg-config libssl-dev zlib1g-dev libopus-dev -y;
|
||||
|
||||
- name: Cache CPM
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: "~/.cache/CPM/"
|
||||
key: ${{ runner.os }}-CPM
|
||||
|
||||
- name: Configure debug
|
||||
run: cd scripts; CPM_SOURCE_CACHE="~/.cache/CPM/" ./configure-debug.sh
|
||||
|
||||
- name: Configure release
|
||||
run: cd scripts; CPM_SOURCE_CACHE="~/.cache/CPM/" ./configure-release.sh
|
||||
|
||||
- name: Configure RelWithDeb
|
||||
run: cd scripts; CPM_SOURCE_CACHE="~/.cache/CPM/" ./configure-relwithdeb.sh
|
||||
|
||||
- name: Build debug
|
||||
run: cd scripts; ./build-debug.sh
|
||||
|
||||
- name: Build release
|
||||
run: cd scripts; ./build-release.sh
|
||||
|
||||
- name: Build Release with debug info
|
||||
run: cd scripts; ./build-relwithdeb.sh
|
||||
|
||||
- name: Packaging
|
||||
run: |-
|
||||
tar -I 'pigz -9' -cf dppbots-debug-amd64.tar.gz --transform 's,^,dppbots/,' bin/Debug src cmake CMakeLists.txt LICENSE;
|
||||
tar -I 'pigz -9' -cf dppbots-rel-amd64.tar.gz --transform 's,^,dppbots/,' bin/Release src cmake CMakeLists.txt LICENSE;
|
||||
tar -I 'pigz -9' -cf dppbots-relwithdeb-amd64.tar.gz --transform 's,^,dppbots/,' bin/Relwithdeb src cmake CMakeLists.txt LICENSE;
|
||||
|
||||
- uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
files: |-
|
||||
dppbots-debug-amd64.tar.gz
|
||||
dppbots-rel-amd64.tar.gz
|
||||
dppbots-relwithdeb-amd64.tar.gz
|
||||
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
build/
|
||||
.cache
|
||||
bin
|
||||
|
||||
77
.vscode/tasks.json
vendored
Normal file
77
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Configure: Debug",
|
||||
"type": "shell",
|
||||
"command": "cd scripts; ./configure-debug.sh",
|
||||
"group": {
|
||||
"isDefault": false
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"detail": "Configure Debug"
|
||||
},
|
||||
{
|
||||
"label": "Build: Debug",
|
||||
"type": "shell",
|
||||
"command": "cd scripts; ./build-debug.sh",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"detail": "Build Debug"
|
||||
},
|
||||
{
|
||||
"label": "Configure: Relwithdeb",
|
||||
"type": "shell",
|
||||
"command": "cd scripts; ./configure-relwithdeb.sh",
|
||||
"group": {
|
||||
"isDefault": false
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"detail": "Configure Release with debug info"
|
||||
},
|
||||
{
|
||||
"label": "Build: Relwithdeb",
|
||||
"type": "shell",
|
||||
"command": "cd scripts; ./build-relwithdeb.sh",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"detail": "Build Release with debug info"
|
||||
},
|
||||
{
|
||||
"label": "Clean: Debug",
|
||||
"type": "shell",
|
||||
"command": "cd build/debug; ninja clean",
|
||||
"group": {
|
||||
"isDefault": false
|
||||
},
|
||||
"detail": "Clean debug files"
|
||||
},
|
||||
{
|
||||
"label": "Build: All",
|
||||
"type": "shell",
|
||||
"command": "cd scripts; ./build.sh",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"detail": "Build all types"
|
||||
},
|
||||
{
|
||||
"label": "Clean: All",
|
||||
"type": "shell",
|
||||
"command": "cd scripts; ./clean.sh",
|
||||
"group": {
|
||||
"isDefault": false
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"detail": "Clean All files"
|
||||
}
|
||||
]
|
||||
}
|
||||
19
CMakeLists.txt
Normal file
19
CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
cmake_minimum_required(VERSION 3.28)
|
||||
project(dppbots)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
|
||||
|
||||
file(GLOB REQUIRED_CMAKE_FILES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/*.cmake.required"
|
||||
)
|
||||
foreach(cmake_file ${REQUIRED_CMAKE_FILES})
|
||||
include(${cmake_file})
|
||||
endforeach()
|
||||
|
||||
file(GLOB CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/*.cmake")
|
||||
foreach(cmake_file ${CMAKE_FILES})
|
||||
include(${cmake_file})
|
||||
endforeach()
|
||||
|
||||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src/00_project")
|
||||
18
LICENSE
Normal file
18
LICENSE
Normal file
@@ -0,0 +1,18 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 firewire
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial
|
||||
portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
||||
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
24
cmake/CPM.cmake.required
Normal file
24
cmake/CPM.cmake.required
Normal file
@@ -0,0 +1,24 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
|
||||
|
||||
set(CPM_DOWNLOAD_VERSION 0.42.1)
|
||||
set(CPM_HASH_SUM "f3a6dcc6a04ce9e7f51a127307fa4f699fb2bade357a8eb4c5b45df76e1dc6a5")
|
||||
|
||||
if(CPM_SOURCE_CACHE)
|
||||
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
|
||||
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
else()
|
||||
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
endif()
|
||||
|
||||
# Expand relative path. This is important if the provided path contains a tilde (~)
|
||||
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
|
||||
|
||||
file(DOWNLOAD
|
||||
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
|
||||
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
|
||||
)
|
||||
|
||||
include(${CPM_DOWNLOAD_LOCATION})
|
||||
14
cmake/compileCommands.cmake
Normal file
14
cmake/compileCommands.cmake
Normal file
@@ -0,0 +1,14 @@
|
||||
##### SETUP COMPILE COMMANDS #####
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
|
||||
endif()
|
||||
|
||||
if(EXISTS "${CMAKE_BINARY_DIR}/compile_commands.json")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
file(
|
||||
COPY "${CMAKE_BINARY_DIR}/compile_commands.json"
|
||||
DESTINATION "${CMAKE_BINARY_DIR}/../"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
11
cmake/copy_files.cmake
Normal file
11
cmake/copy_files.cmake
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
function(create_copy_folder_target target_name src dst)
|
||||
add_custom_target(${target_name}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
-E copy_directory
|
||||
${src}
|
||||
${dst}
|
||||
COMMENT "Copying ${src} to ${dst}"
|
||||
)
|
||||
endfunction()
|
||||
11
cmake/dpp.cmake
Normal file
11
cmake/dpp.cmake
Normal file
@@ -0,0 +1,11 @@
|
||||
CPMAddPackage(
|
||||
URI "gh:brainboxdotcc/DPP@10.1.5"
|
||||
OPTIONS "BUILD_VOICE_SUPPORT ON"
|
||||
OPTIONS "RUN_LDCONFIG OFF"
|
||||
OPTIONS "DPP_INSTALL OFF"
|
||||
OPTIONS "DPP_BUILD_TEST OFF"
|
||||
OPTIONS "DPP_NO_VCPKG ON"
|
||||
OPTIONS "DPP_NO_CONAN ON"
|
||||
OPTIONS "DPP_FORMATTERS ON"
|
||||
OPTIONS "DPP_USE_PCH ON"
|
||||
)
|
||||
14
cmake/macros.cmake
Normal file
14
cmake/macros.cmake
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
macro(SET_OUTPUT_NAMES projname)
|
||||
if (UNIX)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set_target_properties(${projname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/Debug")
|
||||
endif()
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
set_target_properties(${projname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/Release")
|
||||
endif()
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
set_target_properties(${projname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/Relwithdeb")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
10
cmake/platform.cmake
Normal file
10
cmake/platform.cmake
Normal file
@@ -0,0 +1,10 @@
|
||||
message("System name: ${CMAKE_HOST_SYSTEM_NAME}")
|
||||
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
|
||||
add_compile_definitions(PLATFORM_WINDOWS)
|
||||
elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
|
||||
add_compile_definitions(PLATFORM_LINUX)
|
||||
elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
add_compile_definitions(PLATFORM_MACOS)
|
||||
else()
|
||||
add_compile_definitions(PLATFORM_UNKNOWN)
|
||||
endif()
|
||||
8
scripts/build-debug.sh
Executable file
8
scripts/build-debug.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#/bin/bash
|
||||
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build
|
||||
mkdir -p debug
|
||||
cd debug
|
||||
ninja
|
||||
8
scripts/build-release.sh
Executable file
8
scripts/build-release.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#/bin/bash
|
||||
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build
|
||||
mkdir -p release
|
||||
cd release
|
||||
ninja
|
||||
8
scripts/build-relwithdeb.sh
Executable file
8
scripts/build-relwithdeb.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#/bin/bash
|
||||
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build
|
||||
mkdir -p relwithdeb
|
||||
cd relwithdeb
|
||||
ninja
|
||||
32
scripts/build.sh
Executable file
32
scripts/build.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ../
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
mkdir -p debug
|
||||
mkdir -p release
|
||||
mkdir -p relwithdeb
|
||||
|
||||
cd debug || exit
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Debug &
|
||||
cd ../
|
||||
cd release || exit
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Release &
|
||||
cd ../
|
||||
cd relwithdeb || exit
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo &
|
||||
cd ../
|
||||
|
||||
wait
|
||||
|
||||
cd debug || exit
|
||||
ninja &
|
||||
cd ../
|
||||
cd release || exit
|
||||
ninja &
|
||||
cd ../
|
||||
cd relwithdeb || exit
|
||||
ninja &
|
||||
cd ../..
|
||||
|
||||
wait
|
||||
13
scripts/clean.sh
Executable file
13
scripts/clean.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ..
|
||||
cd build/debug || exit
|
||||
ninja clean
|
||||
|
||||
cd ..
|
||||
cd release || exit
|
||||
ninja clean
|
||||
|
||||
cd ..
|
||||
cd relwithdeb || exit
|
||||
ninja clean
|
||||
8
scripts/configure-debug.sh
Executable file
8
scripts/configure-debug.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#/bin/bash
|
||||
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build
|
||||
mkdir -p debug
|
||||
cd debug
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Debug
|
||||
8
scripts/configure-release.sh
Executable file
8
scripts/configure-release.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#/bin/bash
|
||||
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build
|
||||
mkdir -p release
|
||||
cd release
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
8
scripts/configure-relwithdeb.sh
Executable file
8
scripts/configure-relwithdeb.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#/bin/bash
|
||||
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build
|
||||
mkdir -p relwithdeb
|
||||
cd relwithdeb
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
11
src/00_project/CMakeLists.txt
Normal file
11
src/00_project/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.28)
|
||||
project(dppbots)
|
||||
message("Setting up 00_project")
|
||||
add_executable(00_project "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp")
|
||||
target_include_directories(00_project PUBLIC
|
||||
"${dpp_SOURCE_DIR}/include"
|
||||
)
|
||||
target_link_libraries(00_project
|
||||
dpp
|
||||
)
|
||||
SET_OUTPUT_NAMES(00_project)
|
||||
10
src/00_project/src/main.cpp
Normal file
10
src/00_project/src/main.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <discordvoiceclient.h>
|
||||
#include <dpp/dpp.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Using dpp version: " << dpp::utility::version() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
53
todo.md
Normal file
53
todo.md
Normal file
@@ -0,0 +1,53 @@
|
||||
├── 01_basics
|
||||
│ ├── 01_first_bot
|
||||
│ ├── 02_embeds
|
||||
│ ├── 03_private_messages
|
||||
│ ├── 04_adding_files
|
||||
│ ├── 05_webhooks
|
||||
│ ├── 06_callback_functions
|
||||
│ ├── 07_cache
|
||||
│ └── 08_listening_to_messages
|
||||
├── 02_interactions_and_components
|
||||
│ ├── 01_slash_commands
|
||||
│ │ ├── 01_using_slash_cmds
|
||||
│ │ ├── 02_clearing_registered_cmds
|
||||
│ │ ├── 03_sub_commands
|
||||
│ │ ├── 04_autocompletion
|
||||
│ │ ├── 05_file_parameters
|
||||
│ │ └── 06_cmd_handler
|
||||
│ ├── 02_ephemeral_replies
|
||||
│ ├── 03_user_apps
|
||||
│ ├── 04_resolved_objects
|
||||
│ ├── 05_message_components
|
||||
│ │ ├── 01_btn
|
||||
│ │ ├── 02_advanced_btn
|
||||
│ │ ├── 03_select_menu
|
||||
│ │ ├── 04_select_menu_defaults
|
||||
│ │ ├── 05_editing_msg_from_btn
|
||||
│ │ └── 06_components_v2
|
||||
│ ├── 06_modals
|
||||
│ ├── 07_context_menus
|
||||
│ └── 08_thinking
|
||||
├── 03_music_and_audio
|
||||
│ ├── 01_sound_board
|
||||
│ ├── 02_opus_file
|
||||
│ ├── 03_mp3_file
|
||||
│ ├── 04_recording_vc
|
||||
│ └── 05_join_or_switch_channel
|
||||
├── 04_coroutines
|
||||
│ ├── 01_intro
|
||||
│ ├── 02_simple_cmds
|
||||
│ ├── 03_waiting_for_events
|
||||
│ └── 04_expiring_btn
|
||||
└── 05_misc
|
||||
├── 01_arbitrary_requests
|
||||
├── 02_spdlog
|
||||
├── 03_editing_channels_msgs
|
||||
├── 04_threads
|
||||
├── 05_caching_messages
|
||||
├── 06_collecting_reactions
|
||||
├── 07_eval_cmd
|
||||
├── 08_checking_permissions
|
||||
├── 09_bot_status
|
||||
├── 10_emojis
|
||||
└── 11_timers
|
||||
Reference in New Issue
Block a user