From 201cb403595304a6902652fbd369b2b45967ea7d Mon Sep 17 00:00:00 2001 From: Vasily Date: Mon, 24 Jun 2019 18:36:21 +0200 Subject: [PATCH] Add variable for clang-tidy name when building on Linux Travis has the correct clang-tidy version of 7, while CircleCI needs clang-tidy-7. --- .circleci/config.yml | 1 + build_scripts/linux/run-clang-tidy.sh | 9 +++++++-- docs/building_for_linux.md | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 79aece3..46472cc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -97,6 +97,7 @@ jobs: QMAKE_SPEC: linux-clang QT_SELECT: opt-qt512 USE_TIDY: TRUE + CLANG_TIDY_EXECUTABLE: clang-tidy-7 MAKE_JOBS: 2 docker: - image: "ubuntu:xenial" diff --git a/build_scripts/linux/run-clang-tidy.sh b/build_scripts/linux/run-clang-tidy.sh index 7b38d58..9072d0c 100755 --- a/build_scripts/linux/run-clang-tidy.sh +++ b/build_scripts/linux/run-clang-tidy.sh @@ -1,10 +1,15 @@ set +e -clang-tidy-7 --version + +if [[ -z $CLANG_TIDY_EXECUTABLE ]]; then + CLANG_TIDY_EXECUTABLE='clang-tidy' +fi + +$CLANG_TIDY_EXECUTABLE --version ERROR=0 for file in $(find ../src -name "*.cpp"); do echo $file - clang-tidy-7 $file + $CLANG_TIDY_EXECUTABLE $file EXIT=$? if [[ $EXIT != 0 ]]; then diff --git a/docs/building_for_linux.md b/docs/building_for_linux.md index 05602a3..e223127 100644 --- a/docs/building_for_linux.md +++ b/docs/building_for_linux.md @@ -166,6 +166,8 @@ The following environmental variables are relevant for building the project. | `NO_X11` | If set the application will be compiled without X11 specific libraries. This disables certain things like sending keystrokes from VR. | | `NO_DBUS` | If set the application will be compiled without DBUS specific functionality. This disables certain things like media keys. | | `MAKE_JOBS` | Argument to `make --jobs`. Defaults to nothing (unlimited amount of jobs). | +| `CLANG_TIDY_EXECUTABLE` | Name of the `clang-tidy` executable. Defaults to `clang-tidy`. Used for specifying a specific version or path, for example `clang-tidy-7`. | + # Building