[dotnet] Avoid using install_name_tool on macOS and specify correct rpath instead (#9819)
* [dotnet] Avoid using install_name_tool on macOS and specify correct rpath instead * Update Xamarin.Shared.Sdk.targets
This commit is contained in:
Родитель
0c0662c46f
Коммит
5e79ca4f23
|
@ -380,7 +380,7 @@
|
|||
|
||||
This doesn't work after linking with these libraries, so this must be fixed to be @executable_path/. Eventually mono will ship dylibs we don't have to fix (https://github.com/dotnet/runtime/issues/34637).
|
||||
-->
|
||||
<Target Name="_UpdateDynamicLibraryId" DependsOnTargets="_ComputeVariables;_ParseBundlerArguments" Inputs="@(_MonoLibrary)" Outputs="@(_MonoLibrary -> '$(_IntermediateNativeLibraryDir)%(Filename)%(Extension)')">
|
||||
<Target Name="_UpdateDynamicLibraryId" DependsOnTargets="_ComputeVariables;_ParseBundlerArguments" Inputs="@(_MonoLibrary)" Outputs="@(_MonoLibrary -> '$(_IntermediateNativeLibraryDir)%(Filename)%(Extension)')" Condition=" '$(_PlatformName)' != 'macOS' ">
|
||||
<PropertyGroup>
|
||||
<_ExecutablePathPrefix Condition="'$(_PlatformName)' != 'macOS'">@executable_path/</_ExecutablePathPrefix>
|
||||
<_ExecutablePathPrefix Condition="'$(_PlatformName)' == 'macOS'">@executable_path/../$(_CustomBundleName)/</_ExecutablePathPrefix>
|
||||
|
@ -409,6 +409,8 @@
|
|||
<PropertyGroup>
|
||||
<_NativeExecutablePublishDir Condition="'$(_PlatformName)' != 'macOS'">$(MSBuildProjectDirectory)$(_AppBundlePath)\</_NativeExecutablePublishDir>
|
||||
<_NativeExecutablePublishDir Condition="'$(_PlatformName)' == 'macOS'">$(MSBuildProjectDirectory)$(_AppBundlePath)\Contents\MacOS\</_NativeExecutablePublishDir>
|
||||
<_DylibRPath Condition="'$(_PlatformName)' != 'macOS'">@executable_path</_DylibRPath>
|
||||
<_DylibRPath Condition="'$(_PlatformName)' == 'macOS'">@executable_path/../$(_CustomBundleName)/</_DylibRPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -421,6 +423,7 @@
|
|||
|
||||
<LinkNativeCode
|
||||
SessionId="$(BuildSessionId)"
|
||||
DylibRPath="$(_DylibRPath)"
|
||||
EntitlementsInExecutable="$(_CompiledEntitlements)"
|
||||
Frameworks="@(_NativeExecutableFrameworks);@(_BindingLibraryFrameworks)"
|
||||
LinkerFlags="@(_BindingLibraryLinkerFlags)"
|
||||
|
|
|
@ -34,6 +34,8 @@ namespace Xamarin.MacDev.Tasks {
|
|||
public string MinimumOSVersion { get; set; }
|
||||
|
||||
public ITaskItem[] Frameworks { get; set; }
|
||||
|
||||
public string DylibRPath { get; set; }
|
||||
#endregion
|
||||
|
||||
public override bool Execute ()
|
||||
|
@ -80,7 +82,7 @@ namespace Xamarin.MacDev.Tasks {
|
|||
|
||||
if (hasDylibs) {
|
||||
arguments.Add ("-rpath");
|
||||
arguments.Add ("@executable_path");
|
||||
arguments.Add (DylibRPath ?? "@executable_path");
|
||||
}
|
||||
|
||||
if (Frameworks != null) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче