1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 04:15:44 +03:00

Merge pull request #11581 from haslinghuis/bump_clang_version

Bump clang version
This commit is contained in:
J Blackman 2022-07-11 10:26:51 +10:00 committed by GitHub
commit c8a75bf6d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 18 deletions

View file

@ -14,7 +14,7 @@ jobs:
release:
name: Release
needs: ci
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Code Checkout
uses: actions/checkout@v2

View file

@ -15,7 +15,7 @@ on:
jobs:
setup:
name: Setup
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
outputs:
targets: ${{ steps.get-targets.outputs.targets }}
steps:
@ -39,7 +39,7 @@ jobs:
build:
name: Build
needs: setup
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
target: ${{ fromJson(needs.setup.outputs.targets) }}
@ -71,7 +71,7 @@ jobs:
test:
name: Test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
@ -88,7 +88,7 @@ jobs:
name: Complete
needs: [build, test]
if: ${{ always() }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check build matrix result
if: ${{ needs.build.result != 'success' }}

View file

@ -16,7 +16,7 @@ variables:
owner: betaflight
repoName: betaflight-pull-requests
releaseNotes: This is a build of a community provided pull request. It may be unstable and result in corrupted configurations or data loss. **Use only for testing.**
vmImage: 'ubuntu-20.04'
vmImage: 'ubuntu-22.04'
name: $(Build.RequestedFor)_$(Build.SourceBranchName)_$(BuildID)

View file

@ -1,7 +1,7 @@
# Building in Ubuntu
Building for Ubuntu platform is remarkably easy.
This document is tested and based on the latest Ubuntu 20.04.03 LTS release and can also be used for WSL(2).
This document is tested and based on the latest Ubuntu 22.04 LTS release and can also be used for WSL(2).
### Clone betaflight repository and install toolchain
@ -16,8 +16,7 @@ This document is tested and based on the latest Ubuntu 20.04.03 LTS release and
Navigate to your local betaflight repository and use the following steps to pull the latest changes and rebuild your version of betaflight:
$ git pull
$ make clean TARGET=MATEKF405
$ make TARGET=MATEKF405 [OPTIONS=RANGEFINDER] [DEBUG=DBG]
$ make MATEKF405 [OPTIONS=RANGEFINDER] [DEBUG=DBG]
Using the optional OPTIONS parameters you can specify options like RANGEFINDER.
Using the optional DEBUG parameter you can specify the debugger.
@ -31,13 +30,13 @@ Make sure to remove `obj/` and `make clean`, before building again.
$ sudo apt update && apt upgrade
$ sudo apt install libatomic1 npm
$ sudo npm install -g gulp-cli yarn
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
$ source ~/.bashrc
$ nvm install v14.18.2 (for exact version please check link below)
$ nvm install v16.15.1 (for exact version please check link below)
See [Betaflight Configurator Development](https://github.com/betaflight/betaflight-configurator#development) for how to build the Betaflight Configurator.
### Flashing a target with Betaflight Configurator on Ubuntu 20.04
### Flashing a target with Betaflight Configurator on Ubuntu 22.04
In most Linux distributions the user won't have access to serial interfaces by default. Flashing a target requires configuration of usb for dfu mode. To add this access right type the following command in a terminal:

View file

@ -472,8 +472,8 @@ GTEST_DIR = ../../lib/test/gtest
# Use clang/clang++ by default
CC := clang-10
CXX := clang++-10
CC := clang-12
CXX := clang++-12
ifeq ($(shell which $(CC) 2>/dev/null),)
$(info Falling back to 'clang'.)
CC := clang
@ -483,7 +483,7 @@ endif
#CC := gcc
#CXX := g++
# These flags are needed for clang 10 (linux / MacOS) to make test work:
# These flags are needed for clang > 10 (linux / MacOS) to make test work:
# -Wno-c99-extensions
# -Wno-reorder
@ -507,11 +507,11 @@ CXX_VERSION = $(shell $(CXX) -dumpversion)
ifeq ($(shell $(CC) -v 2>&1 | grep -q "clang version" && echo "clang"),clang)
# Please revisit versions when new clang version arrive. Supported versions: { Linux / OSX: 7 - 13 }
# Please revisit versions when new clang version arrive. Supported versions: { Linux / OSX: 7 - 14 }
# Travis reports CC_VERSION of 4.2.1
CC_VERSION_MAJOR := $(firstword $(subst ., ,$(CC_VERSION)))
CC_VERSION_CHECK_MIN := 7
CC_VERSION_CHECK_MAX := 13
CC_VERSION_CHECK_MAX := 14
# Added flags for clang 11 - 13 are not backwards compatible
ifeq ($(shell expr $(CC_VERSION_MAJOR) \> 10 \& $(CC_VERSION_MAJOR) \< 14), 1)
@ -521,7 +521,7 @@ COMMON_FLAGS += \
endif
ifeq ($(shell expr $(CC_VERSION_MAJOR) \< $(CC_VERSION_CHECK_MIN) \| $(CC_VERSION_MAJOR) \> $(CC_VERSION_CHECK_MAX)),1)
$(error $(CC) $(CC_VERSION) is not supported. The officially supported version of clang is 'clang-10'. If this is not found, 'clang' is used as a fallback. The version of the compiler must be between $(CC_VERSION_CHECK_MIN) and $(CC_VERSION_CHECK_MAX).)
$(error $(CC) $(CC_VERSION) is not supported. The officially supported version of clang is 'clang-12'. If this is not found, 'clang' is used as a fallback. The version of the compiler must be between $(CC_VERSION_CHECK_MIN) and $(CC_VERSION_CHECK_MAX).)
endif
COMMON_FLAGS += -fblocks