proto文件集成到Visual

proto文件集成到Visual

本文介绍了将Google协议缓冲区.proto文件集成到Visual C ++ 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的 Visual Studio 项目文件中添加了自定义生成步骤,该文件会从中生成 google protobuf .h/.cc文件.proto输入文件.但是我一直想知道是否只有在原始文件的内容已更改的情况下才可以开始编译?

I've added a custom build step to my Visual Studio project files which generates the google protobuf .h/.cc files from the .proto input files. But I've been wondering if it's possible to start a compile only if the content of the proto files has changed?

是否有一种方法可以从自定义构建步骤准确地告诉VisualStudio?将原型文件集成到Visual Studio构建解决方案的最佳方法是什么?

Is there a way to tell VisualStudio from a custom build step exactly that? What is the optimal way to integrate proto files into a visual studio build solution?

目前,在每次构建时,都会更新.proto文件,然后还会更新输出.h/.cc文件的时间戳...然后,该文件会重新编译与此相关的所有内容.在仍然可以直接从Visual Studio进行构建的同时,还有更好的方法吗?

At the moment, at every build the .proto file is updated which then also updates the time stamp of the output .h/.cc files ...which then issues a recompile of everything dependent from that. Is there a better way around it, while still building them directly from visual studio?

推荐答案

也许有帮助.尤其要看伊戈尔·扎沃钦斯基(Igor Zavoychinskiy)的职位:

Maybe this helps. Especially look at the post of Igor Zavoychinskiy:

$(InputDir)\ $(InputName).pb.cc; $(InputDir)\ $(InputName).pb.h

$(InputDir)\$(InputName).pb.cc;$(InputDir)\$(InputName).pb.h

和(也许是?)kmote00:

and (maybe?) kmote00:

这篇关于将Google协议缓冲区.proto文件集成到Visual C ++ 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 04:43