@@ -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