I am using CMake 3.6 to generate a ninja 1.6.0 configuration, compile and statically analyze my code using clang-tidy (LLVM version 3.9.1):
# file copied from http://www.labri.fr/perso/fleury/posts/programming/using-clang-tidy-and-clang-format.html
# Additional targets to perform clang-format/clang-tidy
# Get all project files
file(GLOB_RECURSE
ALL_CXX_SOURCE_FILES
*.[chi]pp *.[chi]xx *.cc *.hh *.ii *.[CHI]
)
# Adding clang-tidy target if executable is found
find_program(CLANG_TIDY "clang-tidy")
if(CLANG_TIDY)
add_custom_target(
clang-tidy
COMMAND clang-tidy
${ALL_CXX_SOURCE_FILES}
--
-std=c++11
${INCLUDE_DIRECTORIES}
)
endif()
.clang-tidy file:
---
Checks: '-*,readability-*'
AnalyzeTemporaryDtors: false
WarningsAsErrors: '*'
HeaderFilterRegex: 'src/'
User: mgalos
CheckOptions:
- key: readability-identifier-naming.AbstractClassCase
value: CamelCase
...
build.bat:
cmake -H. -B_build -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX=_build/_release -DCMAKE_BUILD_TYPE=GENERIC_RELEASE -DBoost_COMPILER=-vc100
The output I'm getting is:
96 warnings treated as errors ninja: build stopped: subcommand failed.
The %errorlevel%
is 0, although ninja clearly says subcommand failed. This variable is important, as it is evaluated by a buildserver and would flag a build as failed.
What can I do to have %errorlevel%
correctly set to != 0?