首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Coverity CMake构建错误

Coverity CMake构建错误
EN

Stack Overflow用户
提问于 2018-07-18 14:01:04
回答 2查看 1.7K关注 0票数 0

我无法让CMake使用Coverity进行构建。我是CMake新手,不知道如何解决这个问题。我可以使用以下命令构建示例程序:

代码语言:javascript
运行
复制
cov-build --dir . gcc sample.cc -o sample.o

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

代码语言:javascript
运行
复制
cov-build --dir . cmake ../

我收到no emit错误:

代码语言:javascript
运行
复制
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
EN

回答 2

Stack Overflow用户

发布于 2018-07-19 07:27:08

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

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

票数 0
EN

Stack Overflow用户

发布于 2020-08-28 13:08:21

对coverity guidline进行编码,我认为cmake并不是简单的情况,您需要命令的完整版本,如下所示:

代码语言:javascript
运行
复制
cov-configure  --template --compiler <compiler-binary-name> --comptype <compiler-type>

示例:

代码语言:javascript
运行
复制
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生成的配置文件。您可以根据需要使用不同的名称。
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51394595

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档