-
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.
update project structure to STM32CubeMX generated CMake
- Loading branch information
1 parent
42b4558
commit d26555e
Showing
39 changed files
with
3,185 additions
and
3,079 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,38 @@ | ||
BasedOnStyle: LLVM | ||
ColumnLimit: 100 | ||
--- | ||
Language: Cpp | ||
Standard: c++20 | ||
IndentWidth: 4 | ||
PPIndentWidth: 4 | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
IndentRequiresClause: true | ||
DerivePointerAlignment: false | ||
PointerAlignment: Left | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
AfterClass: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterExternBlock: true | ||
AfterCaseLabel: true | ||
AfterControlStatement: Always | ||
BeforeElse: true | ||
BeforeCatch: true | ||
BeforeLambdaBody: true | ||
SplitEmptyFunction: false | ||
SplitEmptyRecord: false | ||
SplitEmptyNamespace: false | ||
PackConstructorInitializers: NextLine | ||
AlwaysBreakTemplateDeclarations: Yes | ||
IncludeCategories: | ||
- Regex: '^<([a-z]+)>' | ||
Priority: 0 | ||
FixNamespaceComments: true | ||
AllowShortFunctionsOnASingleLine: Inline | ||
AllowShortLambdasOnASingleLine: Inline | ||
ShortNamespaceLines: 1 |
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,47 @@ | ||
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. | ||
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml | ||
name: CMake on a single platform | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
build: | ||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | ||
# You can convert this to a matrix build if you need cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Git checkout recursively | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Install ARM GCC toolchain | ||
run: | | ||
sudo apt update | ||
sudo apt install -y gcc-arm-none-eabi | ||
- name: Configure CMake | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build | ||
# Build your program with the given configuration | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | ||
|
||
- name: Test | ||
working-directory: ${{github.workspace}}/build | ||
# Execute tests defined by the CMake configuration. | ||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | ||
run: ctest -C ${{env.BUILD_TYPE}} | ||
|
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 |
---|---|---|
|
@@ -48,3 +48,5 @@ build | |
doc/* | ||
/Debug/ | ||
/Release/ | ||
|
||
.vscode/ |
Large diffs are not rendered by default.
Oops, something went wrong.
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,41 @@ | ||
cmake_minimum_required(VERSION 3.22) | ||
|
||
# Setup compiler settings | ||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_C_STANDARD_REQUIRED ON) | ||
set(CMAKE_C_EXTENSIONS ON) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS ON) | ||
|
||
# Define the build type | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Debug") | ||
endif() | ||
|
||
# Include toolchain file | ||
include("cmake/gcc-arm-none-eabi.cmake") | ||
|
||
# Enable compile command to ease indexing with e.g. clangd | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) | ||
|
||
# Enable CMake support for ASM and C languages | ||
enable_language(C CXX ASM) | ||
|
||
project(ProntoInfrared) | ||
|
||
add_executable(${PROJECT_NAME}) | ||
|
||
add_subdirectory(cmake/stm32cubemx) | ||
add_subdirectory(etl) | ||
add_subdirectory(${PROJECT_NAME}) | ||
|
||
target_include_directories(${PROJECT_NAME} PRIVATE | ||
stm32header | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} | ||
stm32cubemx | ||
etl | ||
) |
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,61 @@ | ||
{ | ||
"version": 3, | ||
"configurePresets": [ | ||
{ | ||
"name": "default", | ||
"hidden": true, | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/build/${presetName}", | ||
"toolchainFile": "${sourceDir}/cmake/gcc-arm-none-eabi.cmake", | ||
"cacheVariables": { | ||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON" | ||
} | ||
}, | ||
{ | ||
"name": "Debug", | ||
"inherits": "default", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Debug" | ||
} | ||
}, | ||
{ | ||
"name": "RelWithDebInfo", | ||
"inherits": "default", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "RelWithDebInfo" | ||
} | ||
}, | ||
{ | ||
"name": "Release", | ||
"inherits": "default", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Release" | ||
} | ||
}, | ||
{ | ||
"name": "MinSizeRel", | ||
"inherits": "default", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "MinSizeRel" | ||
} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "Debug", | ||
"configurePreset": "Debug" | ||
}, | ||
{ | ||
"name": "RelWithDebInfo", | ||
"configurePreset": "RelWithDebInfo" | ||
}, | ||
{ | ||
"name": "Release", | ||
"configurePreset": "Release" | ||
}, | ||
{ | ||
"name": "MinSizeRel", | ||
"configurePreset": "MinSizeRel" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.