美文网首页
CMake+mingw 编译protobuf库

CMake+mingw 编译protobuf库

作者: XBruce | 来源:发表于2020-04-02 16:51 被阅读0次
  1. 下载protobuf源码
  2. CMake设置source code路径 protobuf-3.11.4\protobuf\cmake
  3. 指定mingw编译器的gcc和g++路径
  4. 点击configure,这一步会出错,需要指定CMAKE_MAKE_PROGRAM的路径:mingw32-make.exe
    再次点击,
CMake Error at tests.cmake:2 (message):
  Cannot find third_party/googletest directory that's needed to build tests.
  If you use git, make sure you have cloned submodules:
    git submodule update --init --recursive
  If instead you want to skip tests, run cmake with:
    cmake -Dprotobuf_BUILD_TESTS=OFF

这里如果third_party目录缺少test代码,这里如果不需要test的话,编译选项去掉protobuf_BUILD_TESTS

  1. mingw32-make
  2. mingw32-make install

相关文章

网友评论

      本文标题:CMake+mingw 编译protobuf库

      本文链接:https://www.haomeiwen.com/subject/ppqauhtx.html