Skip to content

Commit f3cb360

Browse files
committed
环境变量
1 parent af7a425 commit f3cb360

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

src/PublishAotCross.Compiler.nuproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,14 @@
1717
<BuildAction>None</BuildAction>
1818
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1919
</Content>
20+
21+
<None Include="PublishAotCross.Compiler.targets">
22+
<Pack>true</Pack>
23+
<PackagePath>build</PackagePath>
24+
</None>
25+
<None Include="SetupCompiler.win-x64.targets">
26+
<Pack>true</Pack>
27+
<PackagePath>build</PackagePath>
28+
</None>
2029
</ItemGroup>
2130
</Project>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!-- Only Windows host targeting Linux is currently supported -->
2+
<Import Project="SetupCompiler.win-x64.targets" Condition="$(RuntimeIdentifier.Contains('linux')) and $([MSBuild]::IsOSPlatform('Windows'))" />

src/SetupCompiler.win-x64.targets

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
3+
<PropertyGroup>
4+
<DisableUnsupportedError>true</DisableUnsupportedError>
5+
</PropertyGroup>
6+
7+
<UsingTask TaskName="PrependPath"
8+
TaskFactory="RoslynCodeTaskFactory"
9+
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
10+
11+
<ParameterGroup>
12+
<Value ParameterType="System.String" Required="true" />
13+
</ParameterGroup>
14+
15+
<Task>
16+
<Using Namespace="System" />
17+
<Using Namespace="System.IO" />
18+
<Code Type="Fragment" Language="cs">
19+
<![CDATA[
20+
Environment.SetEnvironmentVariable("PATH", Value + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH"));
21+
]]>
22+
</Code>
23+
</Task>
24+
25+
</UsingTask>
26+
27+
<Target Name="SetPathToClang" BeforeTargets="SetupOSSpecificProps">
28+
29+
<PrependPath Value="$(MSBuildThisFileDirectory)/bin/win-x64" />
30+
31+
</Target>
32+
33+
</Project>

0 commit comments

Comments
 (0)