-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4a42f48
Showing
8 changed files
with
816 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
BasedOnStyle: Google | ||
AccessModifierOffset: '0' | ||
AlignAfterOpenBracket: DontAlign | ||
AlignConsecutiveMacros: 'true' | ||
AlignConsecutiveAssignments: 'false' | ||
AlignEscapedNewlines: Left | ||
AlignOperands: 'true' | ||
AlignTrailingComments: 'true' | ||
ColumnLimit: 80 | ||
IndentWidth: '2' | ||
SpacesInParentheses: 'false' | ||
SpacesInSquareBrackets: 'false' | ||
UseTab: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: C Quality Check and Formatting | ||
on: [push, pull_request] | ||
jobs: | ||
formatting-check: | ||
name: clang-format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v3 | ||
- name: Install clang-format | ||
run: sudo apt install clang-format | ||
- name: Run clang-format | ||
run : | | ||
clang-format -style=file -i $(find . -name "*.c" -o -name "*.h") | ||
clang-format -style=file -i $(find . -name "*.cpp" -o -name "*.hpp") | ||
- name: Commit changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: ${{ github.actor }} | ||
author_email: ${{ github.actor }}@users.noreply.github.com | ||
message: "Code formatting and linting" | ||
add: "." # Add all files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Object files | ||
*.o | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Linker output | ||
*.ilk | ||
*.map | ||
*.exp | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex | ||
|
||
# Debug files | ||
*.dSYM/ | ||
*.su | ||
*.idb | ||
*.pdb | ||
|
||
# Kernel Module Compile Results | ||
*.mod* | ||
*.cmd | ||
.tmp_versions/ | ||
modules.order | ||
Module.symvers | ||
Mkfile.old | ||
dkms.conf | ||
|
||
# CMake files | ||
CMakeCache.txt | ||
cmake_install.cmake | ||
CPackConfig.cmake | ||
_deps/ | ||
Makefile | ||
obj/ | ||
CMakeFiles/ | ||
CPackSourceConfig.cmake | ||
CMakeSettings.json | ||
|
||
# Build files | ||
.cache/ | ||
target/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(cpp-template CXX) | ||
set(CMAKE_CXX_STANDARD 14) # Use C++14 standard for more features | ||
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror") # Set the compiler flags to include all warnings and treat them as errors | ||
|
||
# Adding our source files | ||
file(GLOB_RECURSE PROJECT_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/src/*.c" "${CMAKE_CURRENT_LIST_DIR}/src/*.cpp" "${CMAKE_CURRENT_LIST_DIR}/src/*.cc" "${CMAKE_CURRENT_LIST_DIR}/src/*.cxx") # Define PROJECT_SOURCES as a list of all source files | ||
file(GLOB_RECURSE PROJECT_INCLUDE CONFIGURE_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/include/*.h" "${CMAKE_CURRENT_LIST_DIR}/include/*.hpp" "${CMAKE_CURRENT_LIST_DIR}/include/*.hh" "${CMAKE_CURRENT_LIST_DIR}/include/*.hxx") # Define PROJECT_INCLUDE to be the path to the include directory of the project | ||
|
||
# Declaring our executable | ||
add_executable(${PROJECT_NAME}) | ||
target_sources(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCES}) | ||
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_INCLUDE}) | ||
|
||
# Setting ASSETS_PATH | ||
target_compile_definitions(${PROJECT_NAME} PUBLIC ASSETS_PATH="${CMAKE_CURRENT_SOURCE_DIR}/assets/") # Set the asset path macro to the absolute path on the dev machine | ||
|
||
# Setting our output directory | ||
set_target_properties(${PROJECT_NAME} PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/target/release/" | ||
OUTPUT_NAME ${PROJECT_NAME} | ||
) |
Oops, something went wrong.