Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit bb0a812

Browse files
author
Alex Chi
committed
[PROJ] fix some compiler errors when add the libprotobuf into PrivateDependencyModuleNames
1 parent 8ad9d25 commit bb0a812

File tree

7 files changed

+14
-27
lines changed

7 files changed

+14
-27
lines changed

lib/vs2015win64/libprotobuf-lite.lib

-555 KB
Binary file not shown.

lib/vs2015win64/libprotobuf.lib

-641 KB
Binary file not shown.

lib/vs2015win64/libprotoc.lib

-1.23 MB
Binary file not shown.

lib/vs2015win64/protoc.exe

-970 KB
Binary file not shown.

lib/vs2015win64/protoc.ilk

-3.15 MB
Binary file not shown.

lib/vs2015win64/protoc.pdb

-7.11 MB
Binary file not shown.

libprotobuf.Build.cs

+14-27
Original file line numberDiff line numberDiff line change
@@ -8,51 +8,38 @@ public libprotobuf(TargetInfo Target)
88
{
99
Type = ModuleType.External;
1010

11-
string protobuf_code_directory_path = ModuleDirectoryPath + "/protobuf";
12-
13-
PublicSystemIncludePaths.Add(protobuf_code_directory_path + "/src");
11+
bool is_supported = false;
12+
if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
13+
{
14+
is_supported = true;
1415

15-
string protobuf_lib_directory_full_path = ModuleDirectoryFullPath + "/lib";
16+
string vs_path = "vs"
17+
+ WindowsPlatform.GetVisualStudioCompilerVersionName()
18+
+ ((Target.Platform == UnrealTargetPlatform.Win64) ? "win64" : "");
19+
string protobuf_lib_directory_full_path = System.IO.Path.Combine(ModuleDirectoryFullPath, "lib", vs_path);
1620

17-
if (Target.Platform == UnrealTargetPlatform.Win32)
18-
{
19-
protobuf_lib_directory_full_path += "/vs" + WindowsPlatform.GetVisualStudioCompilerVersionName();
2021
PublicLibraryPaths.Add(protobuf_lib_directory_full_path);
2122

22-
PublicAdditionalLibraries.Add("libprotobuf-lite.lib");
23+
PublicAdditionalLibraries.Add("libprotobuf.lib");
2324

2425
Definitions.AddRange(
2526
new string[]
2627
{
27-
"WIN32",
28+
((Target.Platform == UnrealTargetPlatform.Win64) ? "WIN64" : "WIN32"),
2829
"_WINDOWS",
2930
"NDEBUG",
3031
"GOOGLE_PROTOBUF_CMAKE_BUILD",
3132
});
3233
}
33-
else if (Target.Platform == UnrealTargetPlatform.Win64)
34-
{
35-
protobuf_lib_directory_full_path += "/vs" + WindowsPlatform.GetVisualStudioCompilerVersionName() + "win64";
36-
PublicLibraryPaths.Add(protobuf_lib_directory_full_path);
3734

38-
PublicAdditionalLibraries.Add("libprotobuf-lite.lib");
35+
if (is_supported)
36+
{
37+
string protobuf_code_directory_full_path = System.IO.Path.Combine(ModuleDirectoryFullPath, "protobuf", "src");
3938

40-
Definitions.AddRange(
41-
new string[]
42-
{
43-
"WIN64",
44-
"_WINDOWS",
45-
"NDEBUG",
46-
"GOOGLE_PROTOBUF_CMAKE_BUILD",
47-
});
39+
PublicSystemIncludePaths.Add(protobuf_code_directory_full_path);
4840
}
4941
}
5042

51-
string ModuleDirectoryPath
52-
{
53-
get { return "./"; }
54-
}
55-
5643
string ModuleDirectoryFullPath
5744
{
5845
get { return System.IO.Path.GetFullPath(ModuleDirectory); }

0 commit comments

Comments
 (0)