Skip to content

Commit a6a04c4

Browse files
committedMar 14, 2019
Update our tooling (Clang 5 -> 7, GCC 7 -> 8)
This change permits to use up-to-date compilers, clang-tidy and clang-format It also refactor the tidy/format step to drop the binary selection from scripts and perform it directly in travis
1 parent aafbdd4 commit a6a04c4

File tree

8 files changed

+38
-35
lines changed

8 files changed

+38
-35
lines changed
 

Diff for: ‎.clang-format

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ BraceWrapping:
1313
AfterUnion: true
1414
BeforeCatch: false
1515
BeforeElse: false
16+
FixNamespaceComments: false
1617
AllowShortIfStatementsOnASingleLine: false
1718
IndentCaseLabels: false
1819
AccessModifierOffset: -8

Diff for: ‎.travis.yml

+23-17
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,26 @@ matrix:
1010
fast_finish: true
1111
include:
1212

13-
- env: LINT=1
13+
- env: CLANG_FORMAT=clang-format-7
1414
compiler: clang
1515
os: linux
1616
addons:
1717
apt:
18-
packages: ['clang-format-5.0']
18+
packages: ['clang-format-7']
1919
sources: &sources
20-
- llvm-toolchain-trusty-5.0
20+
- ubuntu-toolchain-r-test
21+
- llvm-toolchain-trusty-7
2122

22-
- env: CLANG_TIDY=1
23+
- env: CLANG_TIDY=clang-tidy-7
2324
compiler: clang
2425
os: linux
2526
script: ./util/travis/clangtidy.sh
2627
addons:
2728
apt:
28-
packages: ['clang-tidy-5.0']
29+
packages: ['clang-7', 'clang++-7', 'clang-tools-7', 'clang-tidy-7']
2930
sources: &sources
30-
- llvm-toolchain-trusty-5.0
31+
- ubuntu-toolchain-r-test
32+
- llvm-toolchain-trusty-7
3133

3234
- env: PLATFORM=Win32
3335
compiler: gcc
@@ -63,12 +65,12 @@ matrix:
6365
sources: &sources
6466
- ubuntu-toolchain-r-test
6567

66-
- env: PLATFORM=Unix COMPILER=gcc-7
68+
- env: PLATFORM=Unix COMPILER=gcc-8
6769
compiler: gcc
6870
os: linux
6971
addons:
7072
apt:
71-
packages: ['gcc-7', 'g++-7']
73+
packages: ['gcc-8', 'g++-8']
7274
sources: &sources
7375
- ubuntu-toolchain-r-test
7476

@@ -81,29 +83,33 @@ matrix:
8183
sources: &sources
8284
- llvm-toolchain-trusty-3.6
8385

84-
- env: PLATFORM=Unix COMPILER=clang-5.0
86+
- env: PLATFORM=Unix COMPILER=clang-7
8587
compiler: clang
8688
os: linux
8789
addons:
8890
apt:
89-
packages: ['clang-5.0', 'clang++-5.0']
91+
packages: ['clang-7', 'clang++-7']
9092
sources: &sources
91-
- llvm-toolchain-trusty-5.0
93+
- ubuntu-toolchain-r-test
94+
- llvm-toolchain-trusty-7
9295

93-
- env: PLATFORM=Unix COMPILER=clang-5.0 FREETYPE=0
96+
- env: PLATFORM=Unix COMPILER=clang-7 FREETYPE=0
9497
compiler: clang
9598
os: linux
9699
addons:
97100
apt:
98-
packages: ['clang-5.0', 'clang++-5.0']
101+
packages: ['clang-7', 'clang++-7']
99102
sources: &sources
100-
- llvm-toolchain-trusty-5.0
103+
- ubuntu-toolchain-r-test
104+
- llvm-toolchain-trusty-7
101105

102-
- env: PLATFORM=Unix COMPILER=clang-5.0 VALGRIND=1
106+
- env: PLATFORM=Unix COMPILER=clang-7 VALGRIND=1
103107
compiler: clang
104108
os: linux
105109
addons:
106110
apt:
107-
packages: ['valgrind', 'clang-5.0', 'clang++-5.0']
111+
packages: ['valgrind', 'clang-7', 'clang++-7']
108112
sources: &sources
109-
- llvm-toolchain-trusty-5.0
113+
- ubuntu-toolchain-r-test
114+
- llvm-toolchain-trusty-7
115+

Diff for: ‎src/irrlicht_changes/irrUString.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2916,13 +2916,13 @@ class ustring16
29162916
ret[0] = unicode::BOM;
29172917
else if (endian == unicode::EUTFEE_LITTLE)
29182918
{
2919-
uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(&ret[0]);
2919+
uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(ret.c_str());
29202920
*ptr8++ = unicode::BOM_ENCODE_UTF16_LE[0];
29212921
*ptr8 = unicode::BOM_ENCODE_UTF16_LE[1];
29222922
}
29232923
else
29242924
{
2925-
uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(&ret[0]);
2925+
uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(ret.c_str());
29262926
*ptr8++ = unicode::BOM_ENCODE_UTF16_BE[0];
29272927
*ptr8 = unicode::BOM_ENCODE_UTF16_BE[1];
29282928
}

Diff for: ‎util/travis/before_install.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ echo "Preparing for $TRAVIS_COMMIT_RANGE"
44

55
. util/travis/common.sh
66

7-
if [[ "${LINT}" == "1" ]]; then
7+
if [[ ! -z "${CLANG_FORMAT}" ]]; then
88
exit 0
99
fi
1010

1111
needs_compile || exit 0
1212

13-
if [[ $PLATFORM == "Unix" ]] || [[ $CLANG_TIDY == "1" ]]; then
14-
if [[ $TRAVIS_OS_NAME == "linux" ]] || [[ $CLANG_TIDY == "1" ]]; then
13+
if [[ $PLATFORM == "Unix" ]] || [[ ! -z "${CLANG_TIDY}" ]]; then
14+
if [[ $TRAVIS_OS_NAME == "linux" ]] || [[ ! -z "${CLANG_TIDY}" ]]; then
1515
install_linux_deps
1616
else
1717
install_macosx_deps

Diff for: ‎util/travis/clangtidy.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
needs_compile || exit 0
55

6-
if hash clang-tidy-5.0 2>/dev/null; then
7-
CLANG_TIDY=clang-tidy-5.0
8-
else
6+
if [ -z "${CLANG_TIDY}" ]; then
97
CLANG_TIDY=clang-tidy
108
fi
119

Diff for: ‎util/travis/common.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ set_linux_compiler_env() {
77
elif [[ "${COMPILER}" == "gcc-6" ]]; then
88
export CC=gcc-6
99
export CXX=g++-6
10-
elif [[ "${COMPILER}" == "gcc-7" ]]; then
11-
export CC=gcc-7
12-
export CXX=g++-7
10+
elif [[ "${COMPILER}" == "gcc-8" ]]; then
11+
export CC=gcc-8
12+
export CXX=g++-8
1313
elif [[ "${COMPILER}" == "clang-3.6" ]]; then
1414
export CC=clang-3.6
1515
export CXX=clang++-3.6
16-
elif [[ "${COMPILER}" == "clang-5.0" ]]; then
17-
export CC=clang-5.0
18-
export CXX=clang++-5.0
16+
elif [[ "${COMPILER}" == "clang-7" ]]; then
17+
export CC=clang-7
18+
export CXX=clang++-7
1919
fi
2020
}
2121

Diff for: ‎util/travis/lint.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#! /bin/bash
22
function perform_lint() {
33
echo "Performing LINT..."
4-
if hash clang-format-5.0 2>/dev/null; then
5-
CLANG_FORMAT=clang-format-5.0
6-
else
4+
if [ -z "${CLANG_FORMAT}" ]; then
75
CLANG_FORMAT=clang-format
86
fi
97
echo "LINT: Using binary $CLANG_FORMAT"

Diff for: ‎util/travis/script.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
needs_compile || exit 0
66

7-
if [[ "$LINT" == "1" ]]; then
7+
if [[ ! -z "${CLANG_FORMAT}" ]]; then
88
# Lint and exit CI
99
perform_lint
1010
exit 0

0 commit comments

Comments
 (0)
Please sign in to comment.