Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Microsoft.NETCore.Native.Windows.targets « BuildIntegration « src - github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 67ce56a2c0b28a716bd93a2d9460936c5ac23c80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?xml version="1.0" encoding="utf-8"?>
<!--
***********************************************************************************************
Microsoft.NETCore.Native.Windows.targets

WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
          created a backup copy.  Incorrect changes to this file will make it
          impossible to load or build your projects from the command-line or the IDE.

This file defines Windows-specific steps in the build process for native AOT compilation.

Licensed to the .NET Foundation under one or more agreements.
The .NET Foundation licenses this file to you under the MIT license.
See the LICENSE file in the project root for more information.
***********************************************************************************************
-->
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <Target Name="CppCompile"
      Inputs="$(IlcCompileOutput)"
      Outputs="$(NativeObject)"
      DependsOnTargets="IlcCompile">

    <ItemGroup>
      <CppCompilerAndLinkerArg Include="/I$(IlcPath)\inc" />
      <CppCompilerAndLinkerArg Include="$(IlcCompileOutput)" />
      <CppCompilerAndLinkerArg Include="/Fo$(NativeObject)" />
      <CppCompilerAndLinkerArg Condition="'$(Configuration)' == 'Debug'" Include="/Od" />
      <CppCompilerAndLinkerArg Condition="'$(Configuration)' != 'Debug'" Include="/O2" />
      <CppCompilerAndLinkerArg Include="/c /nologo /W3 /GS /DCPPCODEGEN /EHs /MT /Zi" />
      <CppCompilerAndLinkerArg Include="$(AdditionalCppCompilerFlags)" />
    </ItemGroup>

    <MakeDir Directories="$(NativeIntermediateOutputPath)" />
    <WriteLinesToFile File="$(NativeIntermediateOutputPath)cl.rsp" Lines="@(CppCompilerAndLinkerArg)" Overwrite="true" />

    <Exec Command="cl @&quot;$(NativeIntermediateOutputPath)cl.rsp&quot;">
    </Exec>
  </Target>

  <Target Name="LinkNative"
      Inputs="$(NativeObject)"
      Outputs="$(NativeBinary)"
      DependsOnTargets="$(LinkNativeDependsOn)">

    <ItemGroup>
      <NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)\sdk\bootstrapper.lib" />
      <NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)\sdk\Runtime.lib" />
      <NativeLibrary Condition="$(NativeCodeGen) == 'cpp'" Include="$(IlcPath)\sdk\bootstrappercpp.lib" />
      <NativeLibrary Condition="$(NativeCodeGen) == 'cpp'" Include="$(IlcPath)\sdk\PortableRuntime.lib" />
    </ItemGroup>

    <ItemGroup>
      <DefaultLibrary Include="kernel32.lib" />
      <DefaultLibrary Include="user32.lib" />
      <DefaultLibrary Include="gdi32.lib" />
      <DefaultLibrary Include="winspool.lib" />
      <DefaultLibrary Include="comdlg32.lib" />
      <DefaultLibrary Include="advapi32.lib" />
      <DefaultLibrary Include="shell32.lib" />
      <DefaultLibrary Include="ole32.lib" />
      <DefaultLibrary Include="oleaut32.lib" />
      <DefaultLibrary Include="uuid.lib" />
      <DefaultLibrary Include="odbc32.lib" />
      <DefaultLibrary Include="odbccp32.lib" />
    </ItemGroup>

    <ItemGroup>
      <LinkerArg Include="$(NativeObject)" />
      <LinkerArg Include="@(NativeLibrary)" />
      <LinkerArg Include="@(DefaultLibrary)" />
      <LinkerArg Include="/OUT:$(NativeBinary)" />
      <LinkerArg Include="/NOLOGO /DEBUG /MANIFEST:NO" />
    </ItemGroup>

    <ItemGroup>
      <!-- TODO <LinkerArg Include="/MACHINE:X64" /> -->
    </ItemGroup>
 
    <ItemGroup Condition="'$(Configuration)' != 'Debug'">
      <LinkerArg Include="/INCREMENTAL:NO" />
      <LinkerArg Include="/OPT:REF" />
      <LinkerArg Include="/OPT:ICF" />
    </ItemGroup>

    <MakeDir Directories="$(NativeIntermediateOutputPath)" />
    <WriteLinesToFile File="$(NativeIntermediateOutputPath)link.rsp" Lines="@(LinkerArg)" Overwrite="true" />

    <MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(NativeBinary)))" />

    <Exec Command="link @&quot;$(NativeIntermediateOutputPath)link.rsp&quot;">
    </Exec>

  </Target>

</Project>