Coverity CMake构建错误

时间:2018-07-18 06:01:04

标签: cmake coverity

我无法使用Coverity构建CMake。我是CMake的新手,不确定如何解决此问题。我可以使用以下命令来构建示例程序:

cov-build --dir . gcc sample.cc -o sample.o

但是,当我尝试使用CMake进行构建

cov-build --dir . cmake ../

我遇到了不发出错误:

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

2 个答案:

答案 0 :(得分:0)

“请确保您已配置实际在编译中使用的编译器。”

我对这个错误的经验是未配置编译器。在Coverity中用于配置编译器的命令是什么?您会发布_cov_install_ \ config \ coverity_config.xml的内容吗?

答案 1 :(得分:0)

编码为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是覆盖率生成的配置文件。您可以根据需要使用其他名称。