Skip to content

Commit bfe8e92

Browse files
committed
cmake update
1 parent 1640597 commit bfe8e92

12 files changed

Lines changed: 228 additions & 208 deletions

File tree

.github/workflows/main.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: main
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
release:
9+
types: [ published ]
10+
workflow_dispatch:
11+
12+
env:
13+
BUILD_TYPE: release
14+
FW_VERSION: ${GITHUB_REF##*/}
15+
REPOSITORY_NAME: ${GITHUB_REPOSITORY##*/}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
submodules: recursive
24+
- name: Setup GNU Arm Embedded Toolchain
25+
uses: carlosperate/arm-none-eabi-gcc-action@v1.4.0
26+
27+
- name: Setup env
28+
run: |
29+
echo "REPORSIORY=${{env.REPOSITORY_NAME}}" >> "$GITHUB_ENV"
30+
echo "FW_VERSION=${{env.FW_VERSION}}" >> "$GITHUB_ENV"
31+
32+
- name: Setup Ninja
33+
uses: ashutoshvarma/setup-ninja@v1.1
34+
35+
- name: Configure CMake
36+
run: cmake -B ${{github.workspace}}/obj/${{env.BUILD_TYPE}} . -G Ninja -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/sdk/toolchain/toolchain.cmake -DTYPE=${{env.BUILD_TYPE}}
37+
38+
- name: Build With Ninja
39+
run: ninja -C ${{github.workspace}}/obj/${{env.BUILD_TYPE}}
40+
41+
- name: Rename Firmware
42+
if: ${{ github.event_name == 'release' }}
43+
run: mv ${{github.workspace}}/out/release/firmware.bin ${{env.REPOSITORY_NAME}}-${{env.FW_VERSION}}.bin
44+
45+
- name: Release
46+
if: ${{ github.event_name == 'release' }}
47+
uses: softprops/action-gh-release@v0.1.5
48+
env:
49+
GITHUB_TOKEN: ${{ github.token }}
50+
with:
51+
files: ${{env.REPORSIORY}}-${{env.FW_VERSION}}.bin

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ out/
33
.gitmodules
44
.DS_Store
55
firmware.bin
6+
.vscode/

.gitmodules

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
[submodule "sdk"]
22
path = sdk
3-
url = https://github.com/bigclownlabs/bcf-sdk.git
4-
[submodule ".vscode"]
5-
path = .vscode
6-
url = https://github.com/bigclownlabs/bcf-vscode.git
3+
url = https://github.com/hardwario/twr-sdk.git

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.vscode

Lines changed: 0 additions & 1 deletion
This file was deleted.

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cmake_minimum_required(VERSION 3.20.0)
2+
3+
# Setup project name and languages
4+
project(firmware LANGUAGES C ASM)
5+
6+
add_subdirectory(sdk)
7+
8+
# If you need to add some source files to the project add them to the "src" folder and update CMakeLists there
9+
add_subdirectory(src)

Makefile

Lines changed: 0 additions & 21 deletions
This file was deleted.

app/application.c

Lines changed: 0 additions & 158 deletions
This file was deleted.

sdk

Submodule sdk updated 464 files

src/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# List any additional sources here
2+
target_sources(${CMAKE_PROJECT_NAME} PUBLIC application.c)
3+
4+
# If you added some folder with header files you need to list them here
5+
target_include_directories(
6+
${CMAKE_PROJECT_NAME}
7+
PUBLIC
8+
${CMAKE_CURRENT_SOURCE_DIR}
9+
)

0 commit comments

Comments
 (0)