mirror of
https://github.com/focus-creative-games/hybridclr_unity.git
synced 2026-11-20 07:22:39 +08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fbeeb3d959 | |||
| 1f4e754adb | |||
| f63bbc8a52 | |||
| b17751b8a8 | |||
| 05e721cf02 | |||
| 29646f1294 | |||
| 3702411ac8 |
@@ -1,7 +0,0 @@
|
||||
# change logs
|
||||
|
||||
- 2023.04.29 Installer支持从本地目录复制改造后的libil2cpp
|
||||
- 2023.03.28 `HybridCLR/Generate/Il2CppDef`生成的代码位置移到`hybridclr/generated`下
|
||||
- 2022.08.30 创建
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f2a6638b09b52f4c9dc8906d090b710
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d104ab5da8136154899a40116dc88731
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -2,17 +2,17 @@
|
||||
"versions": [
|
||||
{
|
||||
"unity_version":"2019",
|
||||
"hybridclr" : { "branch":"v2.1.0"},
|
||||
"il2cpp_plus": { "branch":"v2019-2.1.0"}
|
||||
"hybridclr" : { "branch":"v2.3.0"},
|
||||
"il2cpp_plus": { "branch":"v2019-2.2.0"}
|
||||
},
|
||||
{
|
||||
"unity_version":"2020",
|
||||
"hybridclr" : { "branch":"v2.2.0"},
|
||||
"hybridclr" : { "branch":"v2.3.0"},
|
||||
"il2cpp_plus": { "branch":"v2020-2.2.0"}
|
||||
},
|
||||
{
|
||||
"unity_version":"2021",
|
||||
"hybridclr" : { "branch":"v2.2.0"},
|
||||
"hybridclr" : { "branch":"v2.3.0"},
|
||||
"il2cpp_plus": { "branch":"v2021-2.2.0"}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace HybridCLR.Editor.ABI
|
||||
case ElementType.Module:
|
||||
case ElementType.Var:
|
||||
case ElementType.MVar:
|
||||
return GetNativeIntTypeInfo();
|
||||
return GetNativeIntTypeInfo();
|
||||
case ElementType.TypedByRef: return CreateValueType(type);
|
||||
case ElementType.ValueType:
|
||||
{
|
||||
@@ -105,7 +105,7 @@ namespace HybridCLR.Editor.ABI
|
||||
|
||||
private static bool IsNotHFAFastCheck(int typeSize)
|
||||
{
|
||||
return typeSize != 8 && typeSize != 12 && typeSize != 16 && typeSize != 24 && typeSize != 32;
|
||||
return typeSize % 4 != 0 || typeSize > 32;
|
||||
}
|
||||
|
||||
private static bool ComputHFATypeInfo0(TypeSig type, HFATypeInfo typeInfo)
|
||||
@@ -169,7 +169,7 @@ namespace HybridCLR.Editor.ABI
|
||||
return false;
|
||||
}
|
||||
bool ok = ComputHFATypeInfo0(type, typeInfo);
|
||||
if (ok && typeInfo.Count >= 2 && typeInfo.Count <= 4)
|
||||
if (ok && typeInfo.Count >= 1 && typeInfo.Count <= 4)
|
||||
{
|
||||
int fieldSize = typeInfo.Type.ElementType == ElementType.R4 ? 4 : 8;
|
||||
return typeSize == fieldSize * typeInfo.Count;
|
||||
@@ -293,6 +293,7 @@ namespace HybridCLR.Editor.ABI
|
||||
bool isFloat = hfaTypeInfo.Type.ElementType == ElementType.R4;
|
||||
switch (hfaTypeInfo.Count)
|
||||
{
|
||||
case 1: return isFloat ? TypeInfo.s_r4 : TypeInfo.s_r8;
|
||||
case 2: return isFloat ? TypeInfo.s_vf2 : TypeInfo.s_vd2;
|
||||
case 3: return isFloat ? TypeInfo.s_vf3 : TypeInfo.s_vd3;
|
||||
case 4: return isFloat ? TypeInfo.s_vf4 : TypeInfo.s_vd4;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace HybridCLR.Editor.ABI
|
||||
{
|
||||
public override bool IsArch32 => false;
|
||||
|
||||
public override bool IsSupportHFA => true;
|
||||
public override bool IsSupportHFA => false;
|
||||
|
||||
protected override TypeInfo OptimizeSigType(TypeInfo type, bool returnType)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Build.Reporting;
|
||||
using UnityEngine;
|
||||
@@ -40,10 +41,32 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (UnityEditor.PlayerSettings.gcIncremental)
|
||||
if (PlayerSettings.gcIncremental)
|
||||
{
|
||||
Debug.LogError($"[CheckSettings] HybridCLR不支持增量式GC,已经自动将该选项关闭");
|
||||
UnityEditor.PlayerSettings.gcIncremental = false;
|
||||
PlayerSettings.gcIncremental = false;
|
||||
}
|
||||
BuildTargetGroup buildTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup;
|
||||
ScriptingImplementation curScriptingImplementation = PlayerSettings.GetScriptingBackend(buildTargetGroup);
|
||||
ScriptingImplementation targetScriptingImplementation = ScriptingImplementation.IL2CPP;
|
||||
if (curScriptingImplementation != targetScriptingImplementation)
|
||||
{
|
||||
Debug.LogError($"[CheckSettings] 当前ScriptingBackend是:{curScriptingImplementation},已经自动切换为:{targetScriptingImplementation}");
|
||||
PlayerSettings.SetScriptingBackend(buildTargetGroup, targetScriptingImplementation);
|
||||
}
|
||||
ApiCompatibilityLevel curApiCompatibilityLevel = PlayerSettings.GetApiCompatibilityLevel(buildTargetGroup);
|
||||
#if UNITY_2021_1_OR_NEWER
|
||||
ApiCompatibilityLevel targetApiCompatibilityLevel = ApiCompatibilityLevel.NET_Unity_4_8;
|
||||
#else
|
||||
ApiCompatibilityLevel targetApiCompatibilityLevel = ApiCompatibilityLevel.NET_4_6;
|
||||
#endif
|
||||
|
||||
|
||||
if (curApiCompatibilityLevel != targetApiCompatibilityLevel)
|
||||
{
|
||||
Debug.LogError($"[CheckSettings] 当前ApiCompatibilityLevel是:{curApiCompatibilityLevel},已经自动切换为 {targetApiCompatibilityLevel}。由于下一次打包才生效,主动打断本次打包。");
|
||||
PlayerSettings.SetApiCompatibilityLevel(buildTargetGroup, ApiCompatibilityLevel.NET_4_6);
|
||||
throw new BuildFailedException("ApiCompatibilityLevel error");
|
||||
}
|
||||
|
||||
var installer = new Installer.InstallerController();
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#if UNITY_EDITOR
|
||||
using System;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Build.Reporting;
|
||||
|
||||
public class MsvcStdextWorkaround : IPreprocessBuildWithReport
|
||||
{
|
||||
const string kWorkaroundFlag = "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS";
|
||||
|
||||
public int callbackOrder => 0;
|
||||
|
||||
public void OnPreprocessBuild(BuildReport report)
|
||||
{
|
||||
var clEnv = Environment.GetEnvironmentVariable("_CL_");
|
||||
|
||||
if (string.IsNullOrEmpty(clEnv))
|
||||
{
|
||||
Environment.SetEnvironmentVariable("_CL_", kWorkaroundFlag);
|
||||
}
|
||||
else if (!clEnv.Contains(kWorkaroundFlag))
|
||||
{
|
||||
clEnv += " " + kWorkaroundFlag;
|
||||
Environment.SetEnvironmentVariable("_CL_", clEnv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // UNITY_EDITOR
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8bff6cadf0b8db54b87ba51b24d080f6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -38,7 +38,7 @@ namespace HybridCLR.Editor.Commands
|
||||
BashUtil.RemoveDir(outputPath);
|
||||
|
||||
var buildOptions = BuildOptions.BuildScriptsOnly;
|
||||
#if UNITY_2021_1_OR_NEWER
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
buildOptions |= BuildOptions.CleanBuildCache;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -107,9 +107,12 @@ namespace HybridCLR.Editor.Installer
|
||||
Debug.LogError($"本地libil2cpp不是合法有效的源码目录. '{_installLibil2cppWithHybridclrSourceDir}'");
|
||||
return;
|
||||
}
|
||||
|
||||
_controller.InstallFromLocal(_installLibil2cppWithHybridclrSourceDir);
|
||||
}
|
||||
else
|
||||
{
|
||||
_controller.InstallDefaultHybridCLR();
|
||||
}
|
||||
_controller.InstallDefaultHybridCLR();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# 发布日志
|
||||
|
||||
|
||||
## 2.4.0
|
||||
|
||||
### 改动
|
||||
|
||||
- CheckSettings中检查ScriptingBackend及ApiCompatibleLevel,切换为正确的值
|
||||
- hybridclr 升级到v2.3.0版本
|
||||
- il2cpp_plus 升级到v2019-2.2.0、v2020-2.2.0、v2021-2.2.0版本
|
||||
|
||||
### 修复
|
||||
|
||||
- 新增 MsvcStdextWorkaround.cs 解决2020 vs下stdext编译错误的问题
|
||||
- 修复当struct只包含一个float或double字段时,在arm64上计算桥接函数签名错误的bug
|
||||
|
||||
## 2.3.1
|
||||
|
||||
### 修复
|
||||
- 修复本地复制libil2cpp却仍然从仓库下载安装的bug
|
||||
|
||||
## 2.3.0
|
||||
|
||||
### 改动
|
||||
|
||||
- Installer支持从本地目录复制改造后的libil2cpp
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复2019版本MonoBleedingEdge的子目录中包含了过长路径的文件导致Installer复制文件出错的问题
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "com.focus-creative-games.hybridclr_unity",
|
||||
"version": "2.3.0",
|
||||
"version": "2.4.0",
|
||||
"displayName": "HybridCLR",
|
||||
"description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR",
|
||||
"category": "Runtime",
|
||||
|
||||
Reference in New Issue
Block a user