Skip to content

Commit 064eac7

Browse files
committed
fix some compile error of ue5.7, fix #2237
1 parent 02ffb46 commit 064eac7

File tree

5 files changed

+32
-15
lines changed

5 files changed

+32
-15
lines changed

unreal/Puerts/Source/CSharpParamDefaultValueMetas/CSharpParamDefaultValueMetas.ubtplugin.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
<EngineVersionFileContent >$([System.IO.File]::ReadAllText($(EngineVersionPath)))</EngineVersionFileContent >
99
<TargetFramework Condition="$(EngineVersionFileContent.Contains('++UE5+Release-5.5'))">net8.0</TargetFramework>
1010
<TargetFramework Condition="!$(EngineVersionFileContent.Contains('++UE5+Release-5.5'))">net6.0</TargetFramework-->
11-
<TargetFramework Condition="Exists('$(EngineDir)\Binaries\ThirdParty\DotNet\8.0.300')">net8.0</TargetFramework>
12-
<TargetFramework Condition="!Exists('$(EngineDir)\Binaries\ThirdParty\DotNet\8.0.300')">net6.0</TargetFramework>
11+
<DotNet8Path>$([System.IO.Directory]::GetDirectories('$(EngineDir)\Binaries\ThirdParty\DotNet', '8.0.*'))</DotNet8Path>
12+
<TargetFramework Condition="'$(DotNet8Path)' != ''">net8.0</TargetFramework>
13+
<TargetFramework Condition="'$(DotNet8Path)' == ''">net6.0</TargetFramework>
1314

1415
<Configuration Condition=" '$(Configuration)' == '' ">Development</Configuration>
1516
<OutputType>Library</OutputType>
@@ -27,6 +28,9 @@
2728
<PropertyGroup Condition=" $(EngineDir.Contains('UE_5.5')) ">
2829
<DefineConstants>$(DefineConstants);UE_5_5_OR_LATER</DefineConstants>
2930
</PropertyGroup>
31+
<PropertyGroup Condition=" $(EngineDir.Contains('UE_5.7')) ">
32+
<DefineConstants>$(DefineConstants);UE_5_5_OR_LATER</DefineConstants>
33+
</PropertyGroup>
3034
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Development|AnyCPU' ">
3135
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
3236
<Optimize>true</Optimize>

unreal/Puerts/Source/JsEnv/JsEnv.Build.cs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,15 @@ public JsEnv(ReadOnlyTargetRules Target) : base(Target)
7373
PublicDefinitions.Add("WITH_WEBSOCKET");
7474
PublicDefinitions.Add("WITH_WEBSOCKET_SSL");
7575
PublicDependencyModuleNames.Add("OpenSSL");
76-
}
77-
76+
}
77+
78+
79+
#if UE_5_6_OR_LATER
80+
CppCompileWarningSettings.ShadowVariableWarningLevel = WarningLevel.Warning;
81+
#else
7882
ShadowVariableWarningLevel = WarningLevel.Warning;
79-
83+
#endif
84+
8085
if (!FTextAsString)
8186
{
8287
PublicDefinitions.Add("PUERTS_FTEXT_AS_OBJECT");
@@ -520,20 +525,20 @@ void ThirdPartyNodejs(ReadOnlyTargetRules Target)
520525
else if (Target.Platform == UnrealTargetPlatform.Android)
521526
{
522527
/*
523-
#if UE_4_19_OR_LATER
528+
#if UE_4_19_OR_LATER
524529
AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(ModuleDirectory, "..", "..", "ThirdParty", "Libnode_APL.xml"));
525-
#else
530+
#else
526531
AdditionalPropertiesForReceipt.Add(new ReceiptProperty("AndroidPlugin", Path.Combine(ModuleDirectory, "..", "..", "ThirdParty", "Libnode_APL.xml")));
527-
#endif
528-
#if UE_4_24_OR_LATER
532+
#endif
533+
#if UE_4_24_OR_LATER
529534
PublicSystemLibraryPaths.Add(Path.Combine(LibraryPath, "Android", "armeabi-v7a"));
530535
PublicSystemLibraryPaths.Add(Path.Combine(LibraryPath, "Android", "arm64-v8a"));
531536
PublicSystemLibraries.Add("node");
532-
#else
537+
#else
533538
PublicLibraryPaths.Add(Path.Combine(LibraryPath, "Android", "armeabi-v7a"));
534539
PublicLibraryPaths.Add(Path.Combine(LibraryPath, "Android", "arm64-v8a"));
535540
PublicAdditionalLibraries.Add("node");
536-
#endif //UE_4_24_OR_LATER
541+
#endif //UE_4_24_OR_LATER
537542
*/
538543

539544
string[] Archs = new string[] { "armeabi-v7a", "arm64-v8a" };

unreal/Puerts/Source/JsEnv/Private/Gen/FLinearColor_Wrap.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ struct AutoRegisterForFLinearColor
5252
.Method("LinearRGBToHSV", MakeFunction(&FLinearColor::LinearRGBToHSV))
5353
.Method("HSVToLinearRGB", MakeFunction(&FLinearColor::HSVToLinearRGB))
5454
.Function("LerpUsingHSV", MakeFunction(&FLinearColor::LerpUsingHSV))
55+
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 6
56+
.Method("Quantize", MakeFunction(&FLinearColor::QuantizeFloor))
57+
#else
5558
.Method("Quantize", MakeFunction(&FLinearColor::Quantize))
59+
#endif
5660
.Method("QuantizeRound", MakeFunction(&FLinearColor::QuantizeRound))
5761
.Method("ToFColor", MakeFunction(&FLinearColor::ToFColor))
5862
.Method("Desaturate", MakeFunction(&FLinearColor::Desaturate))

unreal/Puerts/Source/JsEnv/Private/JSGeneratedClass.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ void UJSGeneratedClass::Restore(UClass* Class)
275275
OrphanedClass->ClassGeneratedBy = Class->ClassGeneratedBy;
276276
#endif
277277

278-
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2
278+
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 7
279+
TObjectPtr<UField>* PP = &Class->Children;
280+
#elif ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2
279281
UField** PP = nullptr;
280282
UField* ChildrenPtr = Class->Children.Get();
281283
PP = &ChildrenPtr;
@@ -303,7 +305,7 @@ void UJSGeneratedClass::Restore(UClass* Class)
303305
JGF->JsFunction.Reset();
304306

305307
*PP = JGF->Next;
306-
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2
308+
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2 && ENGINE_MINOR_VERSION < 7
307309
if (PP == &ChildrenPtr)
308310
{
309311
Class->Children = ChildrenPtr;
@@ -323,7 +325,7 @@ void UJSGeneratedClass::Restore(UClass* Class)
323325
PP = &(*PP)->Next;
324326
}
325327
}
326-
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2
328+
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2 && ENGINE_MINOR_VERSION < 7
327329
PP = &ChildrenPtr;
328330
#else
329331
PP = &Class->Children;

unreal/Puerts/Source/ParamDefaultValueMetas/ParamDefaultValueMetas.Build.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ namespace UnrealBuildTool.Rules
1313
public class ParamDefaultValueMetas : ModuleRules
1414
{
1515
public ParamDefaultValueMetas(ReadOnlyTargetRules Target) : base(Target)
16-
{
16+
{
17+
#if !UE_5_7_OR_LATER
1718
bEnforceIWYU = false;
19+
#endif
1820

1921
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
2022

0 commit comments

Comments
 (0)