Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply ModernCppStarter to the lib and fix memory leaks #83

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7fc1792
apply modern-cpp-template to the lib
Oct 21, 2023
27a9709
fix: added threads fix: tests now linked properly
Oct 21, 2023
64ef9f6
fix some typos in README.md
Oct 21, 2023
7bd5172
fix readme.md
Arniiiii Aug 14, 2024
8019e3a
fixed warnings as error
Arniiiii Aug 15, 2024
9585bb2
update to use latest fmtlib
Arniiiii Aug 15, 2024
9ef993c
a little fix
Arniiiii Aug 15, 2024
87f2d11
fix test https://github.com/fmtlib/fmt/issues/4120
Arniiiii Aug 15, 2024
b55ef8e
fixed: gh workflows: remove installing google testing
Arniiiii Aug 15, 2024
1cc479b
FMT_OS is module specific.
Arniiiii Aug 30, 2024
c56ac96
https://stackoverflow.com/questions/41773161/negate-boolean-variable-…
Arniiiii Aug 30, 2024
48928ca
maybe fix installing
Arniiiii Aug 30, 2024
33f6219
maybe fix installing
Arniiiii Aug 30, 2024
44e4d56
fix ccache handling
Arniiiii Sep 5, 2024
f61c339
get a fucking usable CPM
Arniiiii Sep 6, 2024
2a52ff2
fix first leak
Arniiiii Sep 21, 2024
fb26ff1
fix second leak
Arniiiii Sep 21, 2024
e310609
fix third leak
Arniiiii Sep 21, 2024
99345c1
Merge remote-tracking branch 'upstream/main' into master_copy_merge
Arniiiii Sep 21, 2024
013cbdd
add `build*/` to .gitignore
Arniiiii Sep 21, 2024
ab444bb
apply ModernCppStarter because I feel exhausted maintaining previous …
Arniiiii Sep 23, 2024
df21a91
gitignore ok
Arniiiii Sep 23, 2024
d773bbd
ok...
Arniiiii Sep 23, 2024
ffa7857
ok....
Arniiiii Sep 23, 2024
c38123e
fix one gh workflow
Arniiiii Sep 23, 2024
8ea151e
maybe fix gh workflow for windows
Arniiiii Sep 23, 2024
ce6e58f
somehow mention that it fails on windows.
Arniiiii Sep 23, 2024
5a8ee8e
attempt to fix for windows
Arniiiii Sep 23, 2024
7ab0a46
idk why but it may fix for windows
Arniiiii Sep 23, 2024
672894f
an attempt to fix for msvc
Arniiiii Oct 2, 2024
fa58fc1
remove warning-as-error if tests are going to be build
Arniiiii Oct 2, 2024
40c4324
update README.md
Arniiiii Oct 2, 2024
1736c53
update REAME.md
Arniiiii Oct 2, 2024
1f0a539
fix grammar
Arniiiii Oct 2, 2024
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
56 changes: 56 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
BasedOnStyle: Google
AlignAfterOpenBracket: 'AlwaysBreak'
AllowAllConstructorInitializersOnNextLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AlignConsecutiveMacros: 'true'
AllowShortCaseLabelsOnASingleLine: 'true'
AllowShortFunctionsOnASingleLine: 'None'
AllowShortIfStatementsOnASingleLine: 'Never'
AllowShortLoopsOnASingleLine: 'false'
BreakBeforeBraces: Allman
BinPackArguments: 'false'
BinPackParameters: 'false'
Cpp11BracedListStyle: 'false'
ColumnLimit: 125
NamespaceIndentation: All
SpaceAfterTemplateKeyword: 'false'
SpaceBeforeCtorInitializerColon: 'true'
SpaceBeforeInheritanceColon: 'true'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyBlock: true
Standard: 'Latest'
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 1
SortPriority: 3
CaseSensitive: true
- Regex: '^(<|")(windows.h)'
Priority: 1
SortPriority: 1
- Regex: '^(<|")(processthreadsapi.h)'
Priority: 2
SortPriority: 2
- Regex: '<[[:alnum:].]+>'
Priority: 5
SortPriority: 1
- Regex: '<[[:alnum:].]+_+[[:alnum:].]+>'
Priority: 5
SortPriority: 4
- Regex: '^((<|")(gtest|gmock|isl|json)/)'
Priority: 8
SortPriority: 5
- Regex: '^((<|")(fmt/|fmtlog/))'
Priority: 11
SortPriority: 6
- Regex: '^(<|")(arby)'
Priority: 8
SortPriority: 100
- Regex: '^(<|")./'
Priority: 10
SortPriority: 101
- Regex: '^(<|")(.*)'
Priority: 15
SortPriority: 7
...
6 changes: 6 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm-*,-llvmlibc-*'
CheckOptions: [{ key: misc-non-private-member-variables-in-classes, value: IgnoreClassesWithAllMemberVariablesBeingPublic }]
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
57 changes: 57 additions & 0 deletions .cmake-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
format:
tab_size: 2
line_width: 100
dangle_parens: true

parse:
additional_commands:
cpmaddpackage:
pargs:
nargs: '*'
flags: []
spelling: CPMAddPackage
kwargs: &cpmaddpackagekwargs
NAME: 1
FORCE: 1
VERSION: 1
GIT_TAG: 1
DOWNLOAD_ONLY: 1
GITHUB_REPOSITORY: 1
GITLAB_REPOSITORY: 1
GIT_REPOSITORY: 1
SVN_REPOSITORY: 1
SVN_REVISION: 1
SOURCE_DIR: 1
DOWNLOAD_COMMAND: 1
FIND_PACKAGE_ARGUMENTS: 1
NO_CACHE: 1
GIT_SHALLOW: 1
URL: 1
URL_HASH: 1
URL_MD5: 1
DOWNLOAD_NAME: 1
DOWNLOAD_NO_EXTRACT: 1
HTTP_USERNAME: 1
HTTP_PASSWORD: 1
OPTIONS: +
cpmfindpackage:
pargs:
nargs: '*'
flags: []
spelling: CPMFindPackage
kwargs: *cpmaddpackagekwargs
packageproject:
pargs:
nargs: '*'
flags: []
spelling: packageProject
kwargs:
NAME: 1
VERSION: 1
NAMESPACE: 1
INCLUDE_DIR: 1
INCLUDE_DESTINATION: 1
BINARY_DIR: 1
COMPATIBILITY: 1
VERSION_HEADER: 1
DEPENDENCIES: +
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help me improve
title: "[BUG]"
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

* OS: [e.g. Windows]
* Version [e.g. 10]

**Additional context**
Add any other context about the problem here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---


25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated
when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Provide usage examples**
A few examples of how the feature should be used. Please make sure they are clear
and concise.

**Additional context**
Add any other context or screenshots about the feature request here.
37 changes: 37 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Documentation

on:
push:
tags:
- "*"

env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:
name: Build and publish documentation
runs-on: macos-latest
steps:
- uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: Install dependencies
run: |
brew install doxygen
pip3 install jinja2 Pygments

- name: Build
run: |
cmake -Sdocumentation -Bbuild
cmake --build build --target GenerateDocs

- name: Publish
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/doxygen/html
44 changes: 44 additions & 0 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Install

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: build and install library
run: |
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release --log-level=DEBUG
sudo cmake --build build --target install --verbose -j4
rm -rf build

- name: configure
run: cmake -Stest -Bbuild -DTEST_INSTALLED_VERSION=1 -DCPM_DOWNLOAD_ALL=1 -DCPM_SOURCE_CACHE=~/.cache/cpm --log-level=DEBUG

- name: build
run: cmake --build build --config Debug -j4 --verbose

- name: test
run: |
cd build
ctest --build-config Debug -j4
45 changes: 45 additions & 0 deletions .github/workflows/install_download_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Install_CPM_DOWNLOAD_ALL

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: build and install library
run: |
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCPM_DOWNLOAD_ALL=1 --log-level=DEBUG
cmake --build build --target all -j4 --verbose
cmake --install ./build --prefix ./install_dir
rm -rf build

- name: configure
run: CMAKE_PREFIX_PATH="./install_dir" cmake -Stest -Bbuild -DTEST_INSTALLED_VERSION=1 -DCPM_DOWNLOAD_ALL=1 -DCPM_SOURCE_CACHE=~/.cache/cpm --log-level=DEBUG

- name: build
run: cmake --build build --config Debug -j4 --verbose

- name: test
run: |
cd build
ctest --build-config Debug -j4
38 changes: 38 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: MacOS

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: configure
run: cmake -Stest -Bbuild -DCMAKE_BUILD_TYPE=Debug --log-level=DEBUG

- name: build
run: cmake --build build -j4 --verbose

- name: test
run: |
cd build
ctest --build-config Debug -j4
35 changes: 35 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Style

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: Install format dependencies
run: pip3 install clang-format==14.0.6 cmake_format==0.6.11 pyyaml

- name: configure
run: cmake -Stest -Bbuild --log-level=DEBUG

- name: check style
run: cmake --build build --target check-format -j4 --verbose
Loading