BeppeNanoso
BeppeNanoso

Reputation: 105

Cpplint and CMake - Treat warnings are errors and fail

I'm using cpplint with CMake:

set(CMAKE_CXX_CPPLINT cpplint;
    --filter=-build/include_subdir,-legal/copyright;
    --quiet)

But even if cpplint produces some warnings, the build is still successful.
I cannot find a way to treat those warnings as error (similarly to when using -warnings-as-errors for clang-tidy) and fail the build instead.

Upvotes: 3

Views: 883

Answers (1)

BG1REN
BG1REN

Reputation: 46

CMake always ignores the cpplint exit code.

Source code:

https://github.com/Kitware/CMake/blame/master/Source/cmcmd.cxx#L324

Upvotes: 3

Related Questions