+++ /dev/null
-# This is for cmake-format.
-# See https://github.com/cheshirekow/cmake_format
-# for GUI integration and more details.
-
-# Installation: pip3 install cmake-format
-
-# cmake-format
-# Execution: cmake-format CMakeLists.txt cmake/*.cmake src/CMakeLists.txt unittest/CMakeLists.txt -i
-bullet_char: '*'
-dangle_parens: false
-enum_char: .
-line_ending: unix
-line_width: 80
-separate_ctrl_name_with_space: false
-separate_fn_name_with_space: false
-tab_size: 2
-max_subgroups_hwrap: 3 # default is 2 which prevents trivial set(key value PARENT_SCOPE)
-
-# cmake-lint
-# Execution: cmake-lint CMakeLists.txt cmake/*.cmake src/CMakeLists.txt unittest/CMakeLists.txt
-max_statement_spacing: 2
- libzstd1-dev
- libb2-dev
- # Job 12: Run Clang-Format amd CMake-Format check mode
+ # Job 12: Run Clang-Format in check mode
- os: linux
compiler: clang
env: T="Clang-Format" VERBOSE=1 BUILDEXTRAFLAGS="--target check_format" RUN_TESTS=0
- libzstd1-dev
- libb2-dev
- # Job 12: Run Clang-Format amd CMake-Format check mode
+ # Job 12: Run Clang-Format check mode
- os: linux
compiler: clang
env: T="Clang-Format" VERBOSE=1 BUILDEXTRAFLAGS="--target check_format" RUN_TESTS=0
find_program(CPPCHECK_EXE cppcheck)
mark_as_advanced(CPPCHECK_EXE) # don't show in ccmake
if(CPPCHECK_EXE)
- # cmake-format: off
set(CMAKE_CXX_CPPCHECK
${CPPCHECK_EXE}
--suppressions-list=${CMAKE_SOURCE_DIR}/misc/cppcheck-suppressions.txt
-I ${CMAKE_SOURCE_DIR}
--template="cppcheck: warning: {id}:{file}:{line}: {message}"
-i src/third_party)
- # cmake-format: on
else()
message(WARNING "cppcheck requested but executable not found")
endif()
endif()
include(FeatureSummary)
-# cmake-format: off
-# (behaviour change in cmake-format 0.6.10)
set_package_properties(
libb2 PROPERTIES URL "http://blake2.net/"
DESCRIPTION "C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp")
-# cmake-format: on
endif()
include(FeatureSummary)
-# cmake-format: off
-# (behaviour change in cmake-format 0.6.10)
set_package_properties(
zstd PROPERTIES URL "https://facebook.github.io/zstd"
DESCRIPTION "Zstandard - Fast real-time compression algorithm")
-# cmake-format: on
clang-format --version
find src unittest -path src/third_party -prune -o -regex ".*\.[ch]p?p?" -print0 | xargs -0 -n1 misc/run-clang-format --check
-# Top level CMakeLists.txt + subidrectories.
-# This avoids running the check on any build directories.
-if hash cmake-format 2>/dev/null; then
- printf "cmake-format version "
- cmake-format --version
- CLANG_FORMAT=cmake-format misc/run-clang-format --check CMakeLists.txt
- find cmake -name "*.cmake" -print0 | CLANG_FORMAT=cmake-format xargs -0 -n1 misc/run-clang-format --check
- find src unittest -name "CMakeLists.txt" -print0 | CLANG_FORMAT=cmake-format xargs -0 -n1 misc/run-clang-format --check
-else
- echo "Note: cmake-format not installed. CMake files will not be checked for correct formatting."
- echo "You can install it via pip3 install cmake-format"
-fi
-
echo "Format is ok"
find src unittest -path src/third_party -prune -o -regex ".*\.[ch]p?p?" -exec misc/run-clang-format {} \;
-if hash cmake-format 2>/dev/null; then
- # Top level CMakeLists.txt + subidrectories.
- # This avoids running the check on any build directories.
- cmake-format -i CMakeLists.txt
- find cmake -name "*.cmake" -exec cmake-format -i {} \;
- find src unittest -name "CMakeLists.txt" -exec cmake-format -i {} \;
-else
- echo "Note: cmake-format not installed. CMake files will not be formatted."
- echo "You can install it via pip3 install cmake-format"
-fi
-
echo "Formatting complete"