@@ -8,51 +8,38 @@ public libprotobuf(TargetInfo Target)
8
8
{
9
9
Type = ModuleType . External ;
10
10
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 ;
14
15
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 ) ;
16
20
17
- if ( Target . Platform == UnrealTargetPlatform . Win32 )
18
- {
19
- protobuf_lib_directory_full_path += "/vs" + WindowsPlatform . GetVisualStudioCompilerVersionName ( ) ;
20
21
PublicLibraryPaths . Add ( protobuf_lib_directory_full_path ) ;
21
22
22
- PublicAdditionalLibraries . Add ( "libprotobuf-lite .lib" ) ;
23
+ PublicAdditionalLibraries . Add ( "libprotobuf.lib" ) ;
23
24
24
25
Definitions . AddRange (
25
26
new string [ ]
26
27
{
27
- " WIN32",
28
+ ( ( Target . Platform == UnrealTargetPlatform . Win64 ) ? "WIN64" : " WIN32") ,
28
29
"_WINDOWS" ,
29
30
"NDEBUG" ,
30
31
"GOOGLE_PROTOBUF_CMAKE_BUILD" ,
31
32
} ) ;
32
33
}
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 ) ;
37
34
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" ) ;
39
38
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 ) ;
48
40
}
49
41
}
50
42
51
- string ModuleDirectoryPath
52
- {
53
- get { return "./" ; }
54
- }
55
-
56
43
string ModuleDirectoryFullPath
57
44
{
58
45
get { return System . IO . Path . GetFullPath ( ModuleDirectory ) ; }
0 commit comments