Problem: travis-ci is using outdated clang(-format)

Solution: explicitly select clang-5.0
This commit is contained in:
sigiesec 2018-02-01 16:11:10 +01:00
parent 26b5b5b2d9
commit 749a85cb21
3 changed files with 13 additions and 5 deletions

View File

@ -84,8 +84,14 @@ matrix:
- env: BUILD_TYPE=android CURVE=tweetnacl
os: linux
dist: trusty
- env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1
- env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=/usr/local/clang-5.0.0/bin/clang-format
os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0
sudo: required

View File

@ -30,14 +30,12 @@ add_custom_target(
clang-format-check
COMMAND chmod +x clang-format-check.sh
COMMAND ./clang-format-check.sh
#COMMAND ${CLANG_FORMAT} -style=file -output-replacements-xml ${ALL_SOURCE_FILES} >clang-format-replacements.xml
#COMMAND grep \"<replacement \" clang-format-replacements.xml >/dev/null && exit 1
COMMENT "Checking correct formatting according to .clang-format file"
COMMENT "Checking correct formatting according to .clang-format file using ${CLANG_FORMAT}"
)
add_custom_target(
clang-format-diff
COMMAND ${CLANG_FORMAT} -style=file -i ${ALL_SOURCE_FILES}
COMMAND git diff ${ALL_SOURCE_FILES}
COMMENT "Formatting with clang-format and showing differences with latest commit"
COMMENT "Formatting with clang-format (using ${CLANG_FORMAT}) and showing differences with latest commit"
)

View File

@ -18,6 +18,10 @@ CMAKE_OPTS+=("-DCMAKE_PREFIX_PATH:PATH=${BUILD_PREFIX}")
CMAKE_OPTS+=("-DCMAKE_LIBRARY_PATH:PATH=${BUILD_PREFIX}/lib")
CMAKE_OPTS+=("-DCMAKE_INCLUDE_PATH:PATH=${BUILD_PREFIX}/include")
if [ "$CLANG_FORMAT" != "" ] ; then
CMAKE_OPTS+=("-DCLANG_FORMAT=${CLANG_FORMAT}")
fi
if [ -z $CURVE ]; then
CMAKE_OPTS+=("-DENABLE_CURVE=OFF")
elif [ $CURVE == "libsodium" ]; then