cmake - Cpplint 和 CMake - 将警告视为错误并失败

标签 cmake cpplint

我在 CMake 中使用 cpplint:

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

但即使 cpplint 产生了一些警告,构建仍然成功。
我找不到将这些警告视为错误的方法(类似于将 -warnings-as-errors 用于 clang-tidy 时)并导致构建失败。

最佳答案

CMake 始终忽略 cpplint 退出代码。

源代码:

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

关于cmake - Cpplint 和 CMake - 将警告视为错误并失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61632697/

相关文章:

c++ - c++ 中 if(pointer) 与 if(pointer != NULL) 的区别,cpplint 问题

visual-studio-code - Cpplint 找不到可执行文件

cmake/配置-ix.cmake :401 (get_host_triple) error when trying to build LLVM with CMake on Windows

linux - CMake剥离静态库

c++ - 如何使用传递给编译器的相同参数在cmake中运行命令?

regex - 如何在 cpplint 中使用 exclude_files 正则表达式?

c++ - 向 CMake 引入新的编译器

c++ - 包错误需要修复

emacs - Flycheck-Google-Cpplint 未正确配置

c - 如何强制cppstyle使用c和h文件?