Skip to content

Commit 0288785

Browse files
committed
Don't always set IlcRPath in tests
1 parent 4a22c3e commit 0288785

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/tests/Directory.Build.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,10 @@
527527
variables is horribly slow (seeing 1.4 seconds on a 11th gen Intel Core i7) -->
528528
<IlcUseEnvironmentalTools>true</IlcUseEnvironmentalTools>
529529

530-
<!-- NativeAOT compiled output is placed into a 'native' subdirectory: we need to tweak
530+
<!-- NativeAOT compiled output is placed into a 'native' subdirectory: we need to set
531531
rpath so that the test can load its native library dependencies if there's any -->
532-
<IlcRPath Condition="'$(TargetOS)' == 'osx' or '$(TargetsAppleMobile)' == 'true'">@executable_path/..</IlcRPath>
533-
<IlcRPath Condition="'$(IlcRPath)' == ''">$ORIGIN/..</IlcRPath>
532+
<IlcRPath Condition="'$(SetIlcRPath)' != 'false' and ('$(TargetOS)' == 'osx' or '$(TargetsAppleMobile)' == 'true')">@executable_path/..</IlcRPath>
533+
<IlcRPath Condition="'$(SetIlcRPath)' != 'false' and '$(IlcRPath)' == ''">$ORIGIN/..</IlcRPath>
534534

535535
<!-- Works around "Error: Native compilation can run on x64 and arm64 hosts only" -->
536536
<DisableUnsupportedError>true</DisableUnsupportedError>

src/tests/Interop/DllImportSearchPaths/DllImportSearchPathsTest.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<!-- in its output folder for the purpose of testing assembly loading. -->
55
<RequiresProcessIsolation>true</RequiresProcessIsolation>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
7+
<SetIlcRPath>false</SetIlcRPath>
78
</PropertyGroup>
89
<ItemGroup>
910
<Compile Include="*.cs" />

src/tests/Interop/NativeLibrary/API/NativeLibraryTests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<!-- Finalize in different assembly from Dispose, tries to load the assembly with Dispose after the ALC unload started -->
88
<UnloadabilityIncompatible>true</UnloadabilityIncompatible>
9+
<SetIlcRPath>false</SetIlcRPath>
910
</PropertyGroup>
1011
<ItemGroup>
1112
<Compile Include="*.cs" />
@@ -44,7 +45,11 @@
4445
<ItemGroup>
4546
<NativeLibrariesToCopyAOT Include="$(OutDir)/libNativeLibrary.*" />
4647
<NativeLibrariesToCopyAOT Include="$(OutDir)/NativeLibrary.*" />
48+
<GlobalLoadHelpersToCopy Include="$(OutDir)/libGlobalLoadHelper.*" />
49+
<GlobalLoadHelpersToCopy Include="$(OutDir)/GlobalLoadHelper.*" />
4750
</ItemGroup>
51+
<Copy SourceFiles="@(NativeLibrariesToCopyAOT)" DestinationFiles="@(NativeLibrariesToCopyAOT -> '$(NativeOutputPath)/%(Filename)%(Extension)')" />
4852
<Copy SourceFiles="@(NativeLibrariesToCopyAOT)" DestinationFiles="@(NativeLibrariesToCopyAOT -> '$(NativeOutputPath)/%(Filename)-in-native%(Extension)')" />
53+
<Copy SourceFiles="@(GlobalLoadHelpersToCopy)" DestinationFiles="@(GlobalLoadHelpersToCopy -> '$(NativeOutputPath)/%(Filename)%(Extension)')" />
4954
</Target>
5055
</Project>

0 commit comments

Comments
 (0)