zoukankan      html  css  js  c++  java
  • protocol buffer如何将输出文件编译为DLL

    https://github.com/google/protobuf/blob/master/src/google/protobuf/compiler/cpp/cpp_generator.cc

    bool CppGenerator::Generate(const FileDescriptor* file,
    const string& parameter,
    GeneratorContext* generator_context,
    string* error) const {
    std::vector<std::pair<string, string> > options;
    ParseGeneratorParameter(parameter, &options);
    // -----------------------------------------------------------------
    // parse generator options
    // TODO(kenton): If we ever have more options, we may want to create a
    // class that encapsulates them which we can pass down to all the
    // generator classes. Currently we pass dllexport_decl down to all of
    // them via the constructors, but we don't want to have to add another
    // constructor parameter for every option.
    // If the dllexport_decl option is passed to the compiler, we need to write
    // it in front of every symbol that should be exported if this .proto is
    // compiled into a Windows DLL. E.g., if the user invokes the protocol
    // compiler as:
    // protoc --cpp_out=dllexport_decl=FOO_EXPORT:outdir foo.proto
    // then we'll define classes like this:
    // class FOO_EXPORT Foo {
    // ...
    // }
    // FOO_EXPORT is a macro which should expand to __declspec(dllexport) or
    // __declspec(dllimport) depending on what is being compiled.
    //
    
  • 相关阅读:
    PL/SQL编程急速上手
    MySQL编程
    T-SQL编程
    SQL入门,就这么简单
    前端工具配置(webpack 4、vue-cli 3)
    Vue-router
    Vue组件应用
    Vue.js应用基础
    Bootstrap应用核心
    一篇文章教会你jQuery应用
  • 原文地址:https://www.cnblogs.com/zhongpan/p/8378825.html
Copyright © 2011-2022 走看看