This repository has been archived by the owner on Dec 3, 2022. It is now read-only.
forked from feliwir/libass-msvc
-
Notifications
You must be signed in to change notification settings - Fork 2
/
yasm.targets
101 lines (94 loc) · 3.25 KB
/
yasm.targets
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
97
98
99
100
101
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_PropertySheetDisplayName>Yasm compile targets</_PropertySheetDisplayName>
</PropertyGroup>
<PropertyGroup>
<BuildCompileTargets>
_YasmAssemble;
$(BuildCompileTargets)
</BuildCompileTargets>
</PropertyGroup>
<ItemDefinitionGroup>
<Yasm>
<InputRelativeSourceDir></InputRelativeSourceDir>
<Include></Include>
<ExcludeFromBuild>false</ExcludeFromBuild>
<Config Condition="'$(Platform)'=='Win32'">-m x86 -DARCH_X86_64=0 -DPREFIX -DHAVE_ALIGNED_STACK=0</Config>
<Config Condition="'$(Platform)'=='x64'">-m amd64 -DARCH_X86_64=1 -DHAVE_ALIGNED_STACK=1</Config>
</Yasm>
</ItemDefinitionGroup>
<Target
Name="_YasmAssemble"
DependsOnTargets="ComputeYasmOutputs;YasmAssemble"
Condition="'@(Yasm)' != ''"
/>
<!-- See standard-outdirs.props for explanation of the logic here -->
<Target
Name="ComputeYasmOutputs"
Inputs="@(Yasm)"
Outputs="%(InputRelativeSourceDir)|%(RelativeDir)"
>
<CalculateOutputDir
Items="@(Yasm)"
SourceDir="%(InputRelativeSourceDir)"
DestinationDir=".\"
Condition="'%(Yasm.InputRelativeSourceDir)' != ''"
>
<Output ItemName="_Yasm" TaskParameter="Outputs" />
</CalculateOutputDir>
<ItemGroup>
<!-- If the items don't have the InputRelativeSourceDir metadata, still
copy them to _Yasm and add an OutputDir metadata to them. -->
<_Yasm Include="@(Yasm)" Condition="'%(Yasm.InputRelativeSourceDir)' == ''">
<OutputDir></OutputDir>
</_Yasm>
<!-- Remove items marked for exclusion (e.g. due to platform) -->
<_Yasm Remove="@(_Yasm->WithMetadataValue('ExcludeFromBuild','true'))" />
</ItemGroup>
</Target>
<Target
Name="ComputeYasmFinalOutputDir"
Inputs="@(_Yasm)"
Outputs="%(OutputDir)|%(RelativeDir)"
>
<ItemGroup>
<_Yasm>
<Include>%(Include) -I%(RootDir)%(Directory)</Include>
<OutputDir Condition="'%(OutputDir)' == '.\'"></OutputDir>
<RelativeOutputDir>%(OutputDir)</RelativeOutputDir>
<OutputDir>$(ProjectDir)%(OutputDir)</OutputDir>
</_Yasm>
</ItemGroup>
</Target>
<Target
Name="YasmCreateOutputDir"
DependsOnTargets="ComputeYasmFinalOutputDir"
Inputs="@(_Yasm)"
Outputs="@(_Yasm->'%(OutputDir)')"
>
<MakeDir
Directories="@(_Yasm->'%(OutputDir)')"
/>
</Target>
<Target
Name="YasmAssemble"
DependsOnTargets="ComputeYasmFinalOutputDir;YasmCreateOutputDir"
Inputs="@(_Yasm)"
Outputs="%(_Yasm.OutputDir)%(_Yasm.Filename).obj"
>
<Message
Importance="High"
Text="%(_Yasm.RelativeOutputDir)%(_Yasm.Filename)%(_Yasm.Extension)"
/>
<Exec
Command="Yasm -f win32 %(_Yasm.Config) %(_Yasm.Include) -o "%(_Yasm.OutputDir)%(_Yasm.Filename).obj" "%(_Yasm.FullPath)""
WorkingDirectory="%(_Yasm.OutputDir)"
/>
<ItemGroup>
<Link Include="%(_Yasm.OutputDir)%(_Yasm.Filename).obj" />
<Lib Include="%(_Yasm.OutputDir)%(_Yasm.Filename).obj" />
<ImpLib Include="%(_Yasm.OutputDir)%(_Yasm.Filename).obj" />
</ItemGroup>
</Target>
</Project>