Commit 749a85cb authored by sigiesec's avatar sigiesec

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

Solution: explicitly select clang-5.0
parent 26b5b5b2
......@@ -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
......
......@@ -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"
)
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment