我无法让CMake使用Coverity进行构建。我是CMake新手,不知道如何解决这个问题。我可以使用以下命令构建示例程序:
cov-build --dir . gcc sample.cc -o sample.o但是,当我尝试使用CMake进行构建时
cov-build --dir . cmake ../我收到no emit错误:
Coverity Build Capture (64-bit) version 2017.07 on Linux 3.10.0-693.21.1.el7.x86_64 x86_64
Internal version numbers: 7a4de27b47 p-milo-push-30112.654
-- Using Build Type provided on command line
-- Library config4cpp Found
-- CONFIG4CPP_INCLUDE_DIRS=/opt/config4cpp/include
-- CONFIG4CPP_LIBRARIES=/opt/config4cpp/lib/libconfig4cpp.a
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hitp6130/pulsar
[WARNING] No files were emitted. This may be due to a problem with your configuration
or because no files were actually compiled by your build command.
Please make sure you have configured the compilers actually used in the compilation.
For more details, please look at:
/home/hitp6130/pulsar/build/build-log.txt发布于 2018-07-19 07:27:08
“请确保已配置编译中实际使用的编译器。”
我对这个错误的经验是编译器没有配置。在Coverity中配置编译器的命令是什么?你会发布你的_cov_install_\config\coverity_config.xml的内容吗?
发布于 2020-08-28 13:08:21
对coverity guidline进行编码,我认为cmake并不是简单的情况,您需要命令的完整版本,如下所示:
cov-configure --template --compiler <compiler-binary-name> --comptype <compiler-type>示例:
cov-configure --config cc-config.xml --template --comptype gcc --compiler cc
cmake ..
cov-build --dir <build-dir> --config cc-config.xml make
...cc-config.xml是coverity生成的配置文件。您可以根据需要使用不同的名称。https://stackoverflow.com/questions/51394595
复制相似问题