Skip to content

Commit 2a20d65

Browse files
src (init) πŸ‘¨πŸ»β€πŸ”§: cpp, make, and config files (#8)
Merge pull request #8 from jishanshaikh4/cpp-starter
2 parents 7ba82e7 + 17201a3 commit 2a20d65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+5338
-0
lines changed

β€ŽREADME.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Get started with production ready code in your favorite programming language!
1010
| Ruby on Rails (Ruby) | [rails-starter](https://github.com/jishanshaikh4/start-here/tree/main/rails-starter/) | [Getting Started - RoR](https://guides.rubyonrails.org/getting_started.html) | [Guides - RoR](https://guides.rubyonrails.org/) |
1111
| React Native (JavaScript/TypeScript) | [reactnative-starter](https://github.com/jishanshaikh4/start-here/tree/main/reactNative-starter/) | [Getting Started - React Native](https://reactnative.dev/docs/getting-started) | [Tutorials - React Native](https://reactnative.dev/docs/tutorial) |
1212
| Tauri (Rust + Angular, Vue, Vanilla) | [tauri-starter](https://github.com/jishanshaikh4/start-here/tree/main/tauri-starter/) | [Prerequisites - Tauri](https://tauri.studio/guides/getting-started/prerequisites) | [Start Here - Tauri](https://tauri.studio/guides/getting-started/beginning-tutorial) |
13+
| C++ (gcc, clang, cygwin) | [cpp-starter](https://github.com/jishanshaikh4/start-here/tree/main/cpp-starter/) | [Introduction - C++ ](https://www.cplusplus.com/doc/tutorial/introduction/) | [C++ - Tutorial](https://www.cplusplus.com/doc/tutorial/) |

β€Žcpp-starter/.clang-format

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
AccessModifierOffset: -2
2+
AlignAfterOpenBracket: DontAlign
3+
AlignConsecutiveAssignments: false
4+
AlignConsecutiveDeclarations: false
5+
AlignEscapedNewlines: Left
6+
AlignOperands: true
7+
AlignTrailingComments: false
8+
AllowAllParametersOfDeclarationOnNextLine: false
9+
AllowShortBlocksOnASingleLine: true
10+
AllowShortCaseLabelsOnASingleLine: false
11+
AllowShortFunctionsOnASingleLine: All
12+
AllowShortIfStatementsOnASingleLine: true
13+
AllowShortLoopsOnASingleLine: true
14+
AlwaysBreakAfterDefinitionReturnType: None
15+
AlwaysBreakAfterReturnType: None
16+
AlwaysBreakBeforeMultilineStrings: true
17+
AlwaysBreakTemplateDeclarations: false
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
BraceWrapping:
21+
AfterClass: true
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: true
25+
AfterNamespace: false
26+
AfterObjCDeclaration: false
27+
AfterStruct: true
28+
AfterUnion: false
29+
BeforeCatch: false
30+
BeforeElse: false
31+
IndentBraces: false
32+
SplitEmptyFunction: false
33+
SplitEmptyNamespace: true
34+
SplitEmptyRecord: true
35+
BreakAfterJavaFieldAnnotations: true
36+
BreakBeforeBinaryOperators: NonAssignment
37+
BreakBeforeBraces: Custom
38+
BreakBeforeInheritanceComma: true
39+
BreakBeforeTernaryOperators: true
40+
BreakConstructorInitializers: BeforeColon
41+
BreakConstructorInitializersBeforeComma: false
42+
BreakStringLiterals: true
43+
ColumnLimit: 0
44+
CommentPragmas: '^ IWYU pragma:'
45+
CompactNamespaces: false
46+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
47+
ConstructorInitializerIndentWidth: 2
48+
ContinuationIndentWidth: 2
49+
Cpp11BracedListStyle: false
50+
DerivePointerAlignment: false
51+
DisableFormat: false
52+
ExperimentalAutoDetectBinPacking: true
53+
FixNamespaceComments: true
54+
ForEachMacros:
55+
- foreach
56+
- Q_FOREACH
57+
- BOOST_FOREACH
58+
IncludeCategories:
59+
- Priority: 2
60+
Regex: ^"(llvm|llvm-c|clang|clang-c)/
61+
- Priority: 3
62+
Regex: ^(<|"(gtest|gmock|isl|json)/)
63+
- Priority: 1
64+
Regex: .*
65+
IncludeIsMainRegex: (Test)?$
66+
IndentCaseLabels: false
67+
IndentWidth: 2
68+
IndentWrappedFunctionNames: true
69+
JavaScriptQuotes: Leave
70+
JavaScriptWrapImports: true
71+
KeepEmptyLinesAtTheStartOfBlocks: true
72+
Language: Cpp
73+
MacroBlockBegin: ''
74+
MacroBlockEnd: ''
75+
MaxEmptyLinesToKeep: 2
76+
NamespaceIndentation: Inner
77+
ObjCBlockIndentWidth: 7
78+
ObjCSpaceAfterProperty: true
79+
ObjCSpaceBeforeProtocolList: false
80+
PointerAlignment: Right
81+
ReflowComments: true
82+
SortIncludes: false
83+
SortUsingDeclarations: false
84+
SpaceAfterCStyleCast: false
85+
SpaceAfterTemplateKeyword: false
86+
SpaceBeforeAssignmentOperators: true
87+
SpaceBeforeParens: ControlStatements
88+
SpaceInEmptyParentheses: false
89+
SpacesBeforeTrailingComments: 0
90+
SpacesInAngles: false
91+
SpacesInCStyleCastParentheses: false
92+
SpacesInContainerLiterals: true
93+
SpacesInParentheses: false
94+
SpacesInSquareBrackets: false
95+
Standard: Cpp11
96+
TabWidth: 8
97+
UseTab: Never
98+

β€Žcpp-starter/.clang-tidy

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm-*'
3+
WarningsAsErrors: '*'
4+
HeaderFilterRegex: ''
5+
FormatStyle: none
6+
7+

β€Žcpp-starter/.cmake-format.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
additional_commands:
2+
foo:
3+
flags:
4+
- BAR
5+
- BAZ
6+
kwargs:
7+
DEPENDS: '*'
8+
HEADERS: '*'
9+
SOURCES: '*'
10+
bullet_char: '*'
11+
dangle_parens: false
12+
enum_char: .
13+
line_ending: unix
14+
line_width: 120
15+
max_pargs_hwrap: 3
16+
separate_ctrl_name_with_space: false
17+
separate_fn_name_with_space: false
18+
tab_size: 2
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CMake
2+
3+
on: [push]
4+
5+
env:
6+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7+
BUILD_TYPE: RelWithDebInfo
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Create Build Environment
21+
# Some projects don't allow in-source building, so create a separate build directory
22+
# We'll use this as our working directory for all subsequent commands
23+
run: cmake -E make_directory ${{runner.workspace}}/build
24+
25+
- name: Install conan
26+
shell: bash
27+
run: |
28+
python3 -m pip install --upgrade pip setuptools
29+
python3 -m pip install conan
30+
source ~/.profile
31+
32+
- name: Configure CMake
33+
# Use a bash shell so we can use the same syntax for environment variable
34+
# access regardless of the host operating system
35+
shell: bash
36+
working-directory: ${{runner.workspace}}/build
37+
# Note the current convention is to use the -S and -B options here to specify source
38+
# and build directories, but this is only available with CMake 3.13 and higher.
39+
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
40+
#
41+
# We need to source the profile file to make sure conan is in PATH
42+
run: |
43+
source ~/.profile
44+
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
45+
46+
- name: Build
47+
working-directory: ${{runner.workspace}}/build
48+
shell: bash
49+
# Execute the build. You can specify a specific target with "--target <NAME>"
50+
run: cmake --build . --config $BUILD_TYPE
51+
52+
- name: Test
53+
working-directory: ${{runner.workspace}}/build
54+
shell: bash
55+
# Execute tests defined by the CMake configuration.
56+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
57+
run: ctest -C $BUILD_TYPE

β€Žcpp-starter/.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žcpp-starter/.idea/codeStyles/Project.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žcpp-starter/.idea/codeStyles/codeStyleConfig.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žcpp-starter/.idea/cpp_starter-master.iml

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žcpp-starter/.idea/misc.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žcpp-starter/.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žcpp-starter/.travis.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
language: cpp
2+
3+
install:
4+
- pip install --user conan cmake
5+
6+
jobs:
7+
include:
8+
- os: osx
9+
compiler: gcc
10+
osx_image: xcode11.2 # includes gcc-9 by default
11+
env:
12+
# Conan is at: ${HOME}/Library/Python/2.7/bin: we need this in the path
13+
- PATH="${HOME}/Library/Python/2.7/bin:${PATH}"
14+
- GCC_VER="9"
15+
- MATRIX_EVAL="CC=gcc-${GCC_VER} && CXX=g++-${GCC_VER}"
16+
after_script:
17+
- bash <(curl -s https://codecov.io/bash) -x /usr/bin/gcov-${GCC_VER}
18+
- os: osx
19+
compiler: clang
20+
osx_image: xcode11.2
21+
env:
22+
- PATH="${HOME}/Library/Python/2.7/bin:${PATH}"
23+
- MATRIX_EVAL=""
24+
- os: linux
25+
dist: bionic
26+
compiler: gcc
27+
env:
28+
- GCC_VER="9"
29+
- MATRIX_EVAL="CC=gcc-${GCC_VER} && CXX=g++-${GCC_VER}"
30+
31+
addons:
32+
apt:
33+
sources:
34+
- ubuntu-toolchain-r-test
35+
packages:
36+
# I couldn't get ${GCC_VER} in here successfully
37+
- gcc-9
38+
- g++-9
39+
- doxygen
40+
after_script:
41+
- bash <(curl -s https://codecov.io/bash) -x /usr/bin/gcov-${GCC_VER}
42+
- os: linux
43+
dist: bionic
44+
compiler: clang
45+
env:
46+
- MATRIX_EVAL="CC=clang && CXX=clang++"
47+
addons: { apt: { packages: ['doxygen'] } }
48+
49+
50+
before_script:
51+
- eval "${MATRIX_EVAL}"
52+
53+
script:
54+
- mkdir build
55+
- cd build
56+
- cmake -D ENABLE_COVERAGE:BOOL=TRUE ../
57+
- cmake --build . -- -j2
58+
- ctest -j2
59+
60+
61+

0 commit comments

Comments
Β (0)