Files
MelonLoader/Directory.Build.props
koren 0a2773db47 Add macOS arm64 support and dlsym interpose
Add support for osx-arm64: add ARM64 platform and runtime identifier in Directory.Build.props and define an ARM64 build constant. Include osx-arm64 native libraries (libdobby.a and libplthook.a) and update the osx-x64 plthook. Implement a DYLD dlsym interpose flow because plthook cannot patch modern macOS GOTs: export MLRegisterDlsymHook, MLRealDlsym and MLMacOSJitCopy from native osxentry.cpp, register the managed detour from ModuleSymbolRedirect, and use RealDlsym to resolve genuine runtime symbols. Update the bootstrap project file to keep additional linker symbols and append native exports before native linking. Improve macOS-specific behavior: add JIT copy support for arm64, open a Terminal tailing the MelonLoader log from the macOS launcher script, better resolve the game .app path and frameworks path, and select the appropriate DetourNative platform for macOS ARM64. Also update osxexports.def with the new native exports.
2026-09-29 07:07:55 -05:00

134 lines
5.6 KiB
XML

<Project>
<!--
Project
-->
<PropertyGroup>
<Version>0.7.4</Version>
<AppHostVersion>10.0.8</AppHostVersion>
<BootstrapTarget>net10.0</BootstrapTarget>
<DotNetTarget>net6</DotNetTarget>
<MonoTarget>net35</MonoTarget>
<MonoBleedingEdgeTarget>net472</MonoBleedingEdgeTarget>
<PortablePdbToMdbTarget>netstandard2.0</PortablePdbToMdbTarget>
<Authors>Lava Gang</Authors>
<Company>discord.gg/2Wn3N2P</Company>
<Copyright>Copyright (c) 2020 - 2025 Lava Gang</Copyright>
<Description>The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono.</Description>
<RepositoryUrl>https://github.com/LavaGang/MelonLoader</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<LangVersion>Latest</LangVersion>
<IsPackable>false</IsPackable>
<Configurations>Debug;Release</Configurations>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;linux-x64;osx-x64;osx-arm64</RuntimeIdentifiers>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<CETCompat>false</CETCompat>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>LNK4099</NoWarn>
<InvariantGlobalization>true</InvariantGlobalization>
<RestoreAdditionalProjectSources>https://nuget.bepinex.dev/v3/index.json</RestoreAdditionalProjectSources>
</PropertyGroup>
<!--
Dependencies
-->
<PropertyGroup>
<IcedVersion>1.21.0</IcedVersion>
<TomletVersion>6.2.0</TomletVersion>
<PastelVersion>7.0.1</PastelVersion>
<MonoModVersion>22.7.31.1</MonoModVersion>
<MonoCecilVersion>0.11.6</MonoCecilVersion>
<HarmonyXVersion>2.10.2</HarmonyXVersion>
<AssetToolsVersion>3.0.4</AssetToolsVersion>
<AssetRipperVersion>3.2.0</AssetRipperVersion>
<AsmResolverVersion>6.0.0-beta.5</AsmResolverVersion>
<Il2CppInteropVersion>1.5.1-ci.845</Il2CppInteropVersion>
</PropertyGroup>
<!--
Mono Overrides
-->
<PropertyGroup Condition="'$(TargetFramework)' == '$(MonoTarget)'">
<MonoCecilVersion>0.10.4</MonoCecilVersion>
</PropertyGroup>
<!--
Platform Defaults
-->
<PropertyGroup Condition="'$(ForceRID)' != ''">
<RuntimeIdentifier>$(ForceRID)</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier)' == '' And '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier)' == '' And '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">
<!-- <RuntimeIdentifier>linux-$(Platform)</RuntimeIdentifier> -->
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier)' == '' And '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">
<!-- <RuntimeIdentifier>osx-$(Platform)</RuntimeIdentifier> -->
<RuntimeIdentifier>osx-x64</RuntimeIdentifier>
</PropertyGroup>
<!--
Platform Constants
-->
<PropertyGroup Condition="'$(RuntimeIdentifier.StartsWith(`linux-`))' == 'true'">
<DefineConstants>$(DefineConstants);LINUX</DefineConstants>
<LibPrefix>lib</LibPrefix>
<LibExt>.a</LibExt>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier.StartsWith(`osx-`))' == 'true'">
<!-- TODO: split x64 and arm64 -->
<DefineConstants>$(DefineConstants);OSX</DefineConstants>
<LibPrefix>lib</LibPrefix>
<LibExt>.a</LibExt>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier.StartsWith(`win-`))' == 'true'">
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
<LibExt>.lib</LibExt>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier.EndsWith(`-x64`))' == 'true'">
<DefineConstants>$(DefineConstants);X64</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier.EndsWith(`-arm64`))' == 'true'">
<DefineConstants>$(DefineConstants);ARM64</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<MLOutDir>$(SolutionDir)Output/$(Configuration)/$(RuntimeIdentifier)</MLOutDir>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$(MonoTarget)' Or '$(TargetFramework)' == '$(MonoBleedingEdgeTarget)'">
<ProjectReference Include="$(SolutionDir)/PortablePdbToMdb/PortablePdbToMdb.csproj"
ReferenceOutputAssembly="false"
SkipGetTargetFrameworkProperties="true"
GlobalPropertiesToRemove="TargetFramework" />
</ItemGroup>
<UsingTask TaskName="PortablePdbToMdb"
Condition="'$(TargetFramework)' == '$(MonoTarget)' Or '$(TargetFramework)' == '$(MonoBleedingEdgeTarget)'"
AssemblyFile="$(SolutionDir)/PortablePdbToMdb/bin/PortablePdbToMdb.dll"
TaskFactory="TaskHostFactory" />
<Target Name="SymbolsConvert" Condition="'$(TargetFramework)' == 'net35'" AfterTargets="AfterBuild">
<PortablePdbToMdb AssemblyPath="$(TargetPath)" />
</Target>
</Project>