Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade from clang 5.0 to 7.0 + Add GCC 8 #7159

Merged
merged 2 commits into from Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-format
Expand Up @@ -13,6 +13,7 @@ BraceWrapping:
AfterUnion: true
BeforeCatch: false
BeforeElse: false
FixNamespaceComments: false
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
AccessModifierOffset: -8
Expand Down
40 changes: 23 additions & 17 deletions .travis.yml
Expand Up @@ -10,24 +10,26 @@ matrix:
fast_finish: true
include:

- env: LINT=1
- env: CLANG_FORMAT=clang-format-7
compiler: clang
os: linux
addons:
apt:
packages: ['clang-format-5.0']
packages: ['clang-format-7']
sources: &sources
- llvm-toolchain-trusty-5.0
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7

- env: CLANG_TIDY=1
- env: CLANG_TIDY=clang-tidy-7
compiler: clang
os: linux
script: ./util/travis/clangtidy.sh
addons:
apt:
packages: ['clang-tidy-5.0']
packages: ['clang-7', 'clang++-7', 'clang-tools-7', 'clang-tidy-7']
sources: &sources
- llvm-toolchain-trusty-5.0
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7

- env: PLATFORM=Win32
compiler: gcc
Expand Down Expand Up @@ -63,12 +65,12 @@ matrix:
sources: &sources
- ubuntu-toolchain-r-test

- env: PLATFORM=Unix COMPILER=gcc-7
- env: PLATFORM=Unix COMPILER=gcc-8
compiler: gcc
os: linux
addons:
nerzhul marked this conversation as resolved.
Show resolved Hide resolved
apt:
packages: ['gcc-7', 'g++-7']
packages: ['gcc-8', 'g++-8']
sources: &sources
- ubuntu-toolchain-r-test

Expand All @@ -81,29 +83,33 @@ matrix:
sources: &sources
- llvm-toolchain-trusty-3.6

- env: PLATFORM=Unix COMPILER=clang-5.0
- env: PLATFORM=Unix COMPILER=clang-7
compiler: clang
os: linux
addons:
apt:
packages: ['clang-5.0', 'clang++-5.0']
packages: ['clang-7', 'clang++-7']
sources: &sources
- llvm-toolchain-trusty-5.0
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7

- env: PLATFORM=Unix COMPILER=clang-5.0 FREETYPE=0
- env: PLATFORM=Unix COMPILER=clang-7 FREETYPE=0
compiler: clang
os: linux
addons:
apt:
packages: ['clang-5.0', 'clang++-5.0']
packages: ['clang-7', 'clang++-7']
sources: &sources
- llvm-toolchain-trusty-5.0
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7

- env: PLATFORM=Unix COMPILER=clang-5.0 VALGRIND=1
- env: PLATFORM=Unix COMPILER=clang-7 VALGRIND=1
compiler: clang
os: linux
addons:
apt:
packages: ['valgrind', 'clang-5.0', 'clang++-5.0']
packages: ['valgrind', 'clang-7', 'clang++-7']
sources: &sources
- llvm-toolchain-trusty-5.0
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7

2 changes: 1 addition & 1 deletion src/gui/modalMenu.cpp
Expand Up @@ -260,7 +260,7 @@ bool GUIModalMenu::preprocessEvent(const SEvent &event)
return retval;
}
}
// clang-format on
// clang-format on
#endif
return false;
}
Expand Down
9 changes: 6 additions & 3 deletions src/gui/touchscreengui.h
Expand Up @@ -33,7 +33,8 @@ using namespace irr;
using namespace irr::core;
using namespace irr::gui;

typedef enum {
typedef enum
{
jump_id = 0,
crunch_id,
zoom_id,
Expand Down Expand Up @@ -61,15 +62,17 @@ typedef enum {
joystick_center_id
} touch_gui_button_id;

typedef enum {
typedef enum
{
j_forward = 0,
j_backward,
j_left,
j_right,
j_special1
} touch_gui_joystick_move_id;

typedef enum {
typedef enum
{
AHBB_Dir_Top_Bottom,
AHBB_Dir_Bottom_Top,
AHBB_Dir_Left_Right,
Expand Down
3 changes: 2 additions & 1 deletion src/network/peerhandler.h
Expand Up @@ -24,7 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
namespace con
{

typedef enum {
typedef enum
{
MIN_RTT,
MAX_RTT,
AVG_RTT,
Expand Down
6 changes: 3 additions & 3 deletions util/travis/before_install.sh
Expand Up @@ -4,14 +4,14 @@ echo "Preparing for $TRAVIS_COMMIT_RANGE"

. util/travis/common.sh

if [[ "${LINT}" == "1" ]]; then
if [[ ! -z "${CLANG_FORMAT}" ]]; then
exit 0
fi

needs_compile || exit 0

if [[ $PLATFORM == "Unix" ]] || [[ $CLANG_TIDY == "1" ]]; then
if [[ $TRAVIS_OS_NAME == "linux" ]] || [[ $CLANG_TIDY == "1" ]]; then
if [[ $PLATFORM == "Unix" ]] || [[ ! -z "${CLANG_TIDY}" ]]; then
if [[ $TRAVIS_OS_NAME == "linux" ]] || [[ ! -z "${CLANG_TIDY}" ]]; then
install_linux_deps
else
install_macosx_deps
Expand Down
4 changes: 1 addition & 3 deletions util/travis/clangtidy.sh
Expand Up @@ -3,9 +3,7 @@

needs_compile || exit 0

if hash clang-tidy-5.0 2>/dev/null; then
CLANG_TIDY=clang-tidy-5.0
else
if [ -z "${CLANG_TIDY}" ]; then
CLANG_TIDY=clang-tidy
fi

Expand Down
12 changes: 6 additions & 6 deletions util/travis/common.sh
Expand Up @@ -7,15 +7,15 @@ set_linux_compiler_env() {
elif [[ "${COMPILER}" == "gcc-6" ]]; then
export CC=gcc-6
export CXX=g++-6
elif [[ "${COMPILER}" == "gcc-7" ]]; then
export CC=gcc-7
export CXX=g++-7
elif [[ "${COMPILER}" == "gcc-8" ]]; then
export CC=gcc-8
export CXX=g++-8
elif [[ "${COMPILER}" == "clang-3.6" ]]; then
export CC=clang-3.6
export CXX=clang++-3.6
elif [[ "${COMPILER}" == "clang-5.0" ]]; then
export CC=clang-5.0
export CXX=clang++-5.0
elif [[ "${COMPILER}" == "clang-7" ]]; then
export CC=clang-7
export CXX=clang++-7
fi
}

Expand Down
4 changes: 1 addition & 3 deletions util/travis/lint.sh
@@ -1,9 +1,7 @@
#! /bin/bash
function perform_lint() {
echo "Performing LINT..."
if hash clang-format-5.0 2>/dev/null; then
CLANG_FORMAT=clang-format-5.0
else
if [ -z "${CLANG_FORMAT}" ]; then
CLANG_FORMAT=clang-format
fi
echo "LINT: Using binary $CLANG_FORMAT"
Expand Down
2 changes: 1 addition & 1 deletion util/travis/script.sh
Expand Up @@ -4,7 +4,7 @@

needs_compile || exit 0

if [[ "$LINT" == "1" ]]; then
if [[ ! -z "${CLANG_FORMAT}" ]]; then
# Lint and exit CI
perform_lint
exit 0
Expand Down