代码拉取完成,页面将自动刷新
同步操作将从 leo/UE4Protobuf 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
UE4中编译最新Protobuf 3.11.2的脚本
Windows下编译Win64及Android库
PATH
中Mac机编译IOS库
下载Google Protobuf最新版(protobuf-cpp-x.x.x.zip)。
解压到source
目录下
修改源代码
src/google/protobuf/compiler/cpp/cpp_file.cc
// 方法:FileGenerator::GenerateSourceIncludes
format(
"// Generated by the protocol buffer compiler. DO NOT EDIT!\n"
"// source: $filename$\n"
+ "\n"
+ "// Disable UE4 VS warnings\n"
+ "#ifdef _MSC_VER\n"
+ "#\tpragma warning(disable: 4946)\n"
+ "#\tpragma warning(disable: 4125)\n"
+ "#\tpragma warning(disable: 4647)\n"
+ "#\tpragma warning(disable: 4668)\n"
+ "#\tpragma warning(disable: 4800)\n"
+ "#endif\n"
+ "\n"
"#include $1$\n"
cmake/CMakeLists.txt
add_definitions(-DGOOGLE_PROTOBUF_CMAKE_BUILD)
+ add_definitions(-DGOOGLE_PROTOBUF_NO_RTTI=1)
编译
BuildWindows.bat
中VC的路径为自己安装的路径BuildAndroid.bat
中NDK的路径BuildWindows.bat
BuildAndroid.bat
BuildIOS.sh
UE4集成
Source/ThirdParty
目录下建立文件夹Protobuf
include
, lib
, Protobuf.Build.cs
拷贝到新建的目录下bin
目录下生成protoc.exe
生成*.pb.cc
及*.pb.h
文件AllowWindowsPlatformTypes.h
等文件了,基本不需要改动此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。