Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
138 changes: 138 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
Language: Cpp
# BasedOnStyle: Nothing lol
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveMacros: Consecutive
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterCaseLabel: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyNamespace: false
SplitEmptyRecord: false
BreakAfterJavaFieldAnnotations: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeConceptDeclarations: true
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
StatementAttributeLikeMacros:
- Q_EMIT
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: true
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: true
JavaScriptQuotes: Double
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 3
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 7
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 100
PenaltyBreakComment: 100
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 100
PenaltyExcessCharacter: 1
PenaltyReturnTypeOnItsOwnLine: 20
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInConditionalStatement: false
SpacesInSquareBrackets: false
BitFieldColonSpacing: After
Standard: c++20
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...
88 changes: 88 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
Checks:
'boost-use-to-string,
bugprone-*,
cert-dcl21-cpp,
cert-dcl50-cpp,
cert-dcl58-cpp,
cert-env33-c,
cert-err34-c,
cert-err52-cpp,
cert-err58-cpp,
cert-err60-cpp,
cert-flp30-c,
cert-mem57-cpp,
cert-msc50-cpp,
cert-oop57-cpp,
cert-oop58-cpp,
clang-analyzer-core.DynamicTypePropagation,
clang-analyzer-core.uninitialized.CapturedBlockVariable,
clang-analyzer-cplusplus.InnerPointer,
clang-analyzer-optin.portability.UnixAPI,
clang-analyzer-valist.CopyToSelf,
clang-analyzer-valist.Uninitialized,
clang-analyzer-valist.Unterminated,
concurrency-mt-unsafe,
concurrency-thread-canceltype-asynchronous,
cppcoreguidelines-avoid-goto,
cppcoreguidelines-avoid-non-const-global-variables,
cppcoreguidelines-interfaces-global-init,
cppcoreguidelines-macro-usage,
cppcoreguidelines-narrowing-conversions,
cppcoreguidelines-no-malloc,
cppcoreguidelines-owning-memory,
cppcoreguidelines-prefer-member-initializer,
cppcoreguidelines-pro-bounds-array-to-pointer-decay,
cppcoreguidelines-pro-bounds-constant-array-index,
cppcoreguidelines-pro-type-const-cast,
cppcoreguidelines-pro-type-cstyle-cast,
cppcoreguidelines-pro-type-member-init,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-pro-type-union-access,
cppcoreguidelines-slicing,
cppcoreguidelines-special-member-functions,
fuchsia-multiple-inheritance,
fuchsia-statically-constructed-objects,
fuchsia-virtual-inheritance,
google-build-explicit-make-pair,
google-build-namespaces,
google-build-using-namespace,
google-default-arguments,
google-explicit-constructor,
google-global-names-in-headers,
google-readability-casting,
google-runtime-int,
google-runtime-operator,
google-upgrade-googletest-case,
hicpp-exception-baseclass,
hicpp-multiway-paths-covered,
hicpp-no-assembler,
hicpp-signed-bitwise,
llvm-header-guard,
llvm-include-order,
llvm-namespace-comment,
misc-definitions-in-headers,
misc-misplaced-const,
misc-new-delete-overloads,
misc-non-copyable-objects,
misc-non-private-member-variables-in-classes,
misc-redundant-expression,
misc-static-assert,
misc-throw-by-value-catch-by-reference,
misc-unconventional-assign-operator,
misc-uniqueptr-reset-release,
misc-unused-alias-decls,
misc-unused-parameters,
misc-unused-using-decls,
modernize-*,
-modernize-use-trailing-return-type,
performance-*,
portability-*,
readability-*'
WarningsAsErrors: '*'
HeaderFilterRegex: ''
FormatStyle: none
CheckOptions:
- key: readability-uppercase-literal-suffix.NewSuffixes
value: 'u;ul;ull;l;ll;z;uz;f'

10 changes: 10 additions & 0 deletions .cmake-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
bullet_char: '*'
dangle_parens: true
enum_char: .
line_ending: unix
line_width: 120
max_pargs_hwrap: 3
separate_ctrl_name_with_space: true
separate_fn_name_with_space: false
tab_size: 4

32 changes: 32 additions & 0 deletions .github/cp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const fs = require('fs');
const path = require('path');

const USAGE = "Usage: node cp.js [SOURCE_FILES]... [DESTINATION_DIR]\n";

const args = process.argv.slice(2);

if (args.length < 2) {
console.error(USAGE);
throw new SyntaxError();
}
const src = args.slice(0, -1);
const dest = args[args.length - 1]

if (!fs.existsSync(dest)) {
console.error(`${dest} no such file or directory`)
}
if (!fs.statSync(dest).isDirectory()) {
console.error(`${dest} is not a directory`);
throw new TypeError();
}

for (const f of src) {
if (!fs.existsSync(f)) {
console.error(`${f} no such file or directory`)
}
if (!fs.statSync(f).isFile()) {
console.error(`${f} is not a file`);
throw new TypeError();
}
fs.copyFileSync(f, path.join(dest, path.basename(f)));
}
27 changes: 27 additions & 0 deletions .github/mkdir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const fs = require('fs');

const WARNINGS_ON = true;

const USAGE = "Usage: node mkdir.js [DIR_NAME]\n";

const args = process.argv.slice(2);

if(args.length != 1){
console.error(USAGE);
throw new SyntaxError();
}
const dir = args[0];

if(dir.includes("*")){
throw new SyntaxError("globbing is not supported");
}

if(fs.existsSync(dir)){
if(fs.statSync(dir).isFile()){
throw new Error(`${dir} is a file`);
}
fs.statSync(dir).isDirectory() && WARNINGS_ON && console.warn(`${dir} already exists, doing nothing`);
return;
}

fs.mkdirSync(dir);
19 changes: 19 additions & 0 deletions .github/rm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const fs = require('fs');
const path = require('path');

const USAGE = "Usage: node rm.js [FILES/DIRS]...\n";

const args = process.argv.slice(2);

if (args.length < 1) {
console.error(USAGE);
throw new SyntaxError();
}

for (const f of args) {
if (!fs.existsSync(f)) {
console.warn(`${f} no such file or directory`)
continue;
}
fs.rmSync(f, {recursive: true});
}
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,11 @@ jobs:

- name: Install
run: |
yarn global add node-gyp
yarn install --immutable

- name: Build
if: startsWith(matrix.os, 'macos')
run: yarn release

- name: Build
if: startsWith(matrix.os, 'windows')
run: |
mkdir dist
yarn release:win

- name: Artifact
uses: actions/upload-artifact@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
build
dist
node_modules
native/compile_commands.json
39 changes: 39 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cmake_minimum_required(VERSION 3.15)

# Set the project name to your project name, my project isn't very descriptive
project(VAD LANGUAGES C CXX)
include(cmake/CompileCommands.cmake)
include(cmake/StandardProjectSettings.cmake)
include(cmake/PreventInSourceBuilds.cmake)

# Link this 'library' to set the c++ standard / compile-time options requested
add_library(project_options INTERFACE)
target_compile_features(project_options INTERFACE cxx_std_20)
target_compile_features(project_options INTERFACE c_std_11)

# Link this 'library' to use the warnings specified in CompilerWarnings.cmake
add_library(project_warnings INTERFACE)

# standard compiler warnings
include(cmake/CompilerWarnings.cmake)
set_project_warnings(project_warnings)

# sanitizer options if supported by compiler
include(cmake/Sanitizers.cmake)
enable_sanitizers(project_options)

# allow for static analysis options
include(cmake/StaticAnalyzers.cmake)

# Should use boost?
option(USE_BOOST "Get boost through conan. Configurable in cmake/boost.cmake" OFF)
include(cmake/boost.cmake)
config_boost()

# Set up some extra Conan dependencies based on our needs before loading Conan
set(CONAN_EXTRA_REQUIRES ${BOOST_REQ})
set(CONAN_EXTRA_OPTIONS ${BOOST_OPTS})
include(cmake/Conan.cmake)
run_conan()

add_subdirectory(native)
Loading