Skip to content

Commit

Permalink
Windows: Compute linker inputs from PerlAsm output automatically.
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed Aug 15, 2016
1 parent 6440d1c commit 078d3c2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 43 deletions.
44 changes: 2 additions & 42 deletions crypto/libring.Windows.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="GenerateAsm;Build" ToolsVersion="14.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{F4C0A1B6-5E09-41C8-8242-3E1F6762FB18}</ProjectGuid>
<ProjectName>libring.Windows</ProjectName>
Expand Down Expand Up @@ -75,24 +76,6 @@
<PerlAsm Include="sha/asm/sha256-586.pl" />
<PerlAsm Include="sha/asm/sha512-586.pl" />
</ItemGroup>
<ItemDefinitionGroup Condition="'$(ProcessorArchitecture)' == 'x86'">
<!-- XXX: There's almost definitely a way to defiune the PerlAsm task to
compute this automatically, but for now we do it manually. -->
<Lib>
<AdditionalDependencies>
$(IntDir)aes-586.obj;
$(IntDir)aesni-x86.obj;
$(IntDir)vpaes-x86.obj;
$(IntDir)x86-mont.obj;
$(IntDir)chacha-x86.obj;
$(IntDir)ecp_nistz256-x86.obj;
$(IntDir)ghash-x86.obj;
$(IntDir)poly1305-x86.obj;
$(IntDir)sha256-586.obj;
$(IntDir)sha512-586.obj;
</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemGroup Condition="'$(ProcessorArchitecture)' == 'amd64'">
<PerlAsm Include="aes/asm/aes-x86_64.pl" />
<PerlAsm Include="aes/asm/aesni-x86_64.pl" />
Expand All @@ -116,29 +99,6 @@
<AdditionalDependencies>sha/asm/sha-x86_64.pl</AdditionalDependencies>
</PerlAsm>
</ItemGroup>
<ItemDefinitionGroup Condition="'$(ProcessorArchitecture)' == 'amd64'">
<!-- XXX: There's almost definitely a way to defiune the PerlAsm task to
compute this automatically, but for now we do it manually. -->
<Lib>
<AdditionalDependencies>
$(IntDir)aes-x86_64.obj;
$(IntDir)aesni-x86_64.obj;
$(IntDir)bsaes-x86_64.obj;
$(IntDir)chacha-x86_64.obj;
$(IntDir)vpaes-x86_64.obj;
$(IntDir)rsaz-avx2.obj;
$(IntDir)x86_64-mont.obj;
$(IntDir)x86_64-mont5.obj;
$(IntDir)ecp_nistz256-x86_64.obj;
$(IntDir)p256-x86_64-asm.obj;
$(IntDir)aesni-gcm-x86_64.obj;
$(IntDir)ghash-x86_64.obj;
$(IntDir)poly1305-x86_64.obj;
$(IntDir)sha256-x86_64.obj;
$(IntDir)sha512-x86_64.obj;
</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\include</AdditionalIncludeDirectories>
Expand Down
16 changes: 15 additions & 1 deletion mk/perlasm-msbuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,24 @@
<MakeDir Directories="$(IntDir)"/>
</Target>

<PropertyGroup>
<ComputeLibInputsTargets>
$(ComputeLibInputsTargets);
ComputeGenerateAsmOutput;
</ComputeLibInputsTargets>
</PropertyGroup>

<Target Name="ComputeGenerateAsmOutput">
<ItemGroup>
<Lib Include="$(IntDir)%(PerlAsm.Filename).obj" />
</ItemGroup>
</Target>

<!-- Because this uses `%(PerlAsm.Identity)`, it will be invoked for each
<PerlAsm> item. -->
<Target
Name="GenerateAsm"
DependsOnTargets="CreateIntDir"
BeforeTargets="ClCompile"
Inputs="%(PerlAsm.Identity);
../crypto/perlasm/arm-xlate.pl;
../crypto/perlasm/x86_64-xlate.pl;
Expand Down

0 comments on commit 078d3c2

Please sign in to comment.