tesseract icon indicating copy to clipboard operation
tesseract copied to clipboard

Only copy x64 DLL for project targeting x64

Open sehcheese opened this issue 5 years ago • 1 comments

I have a project that targets 64 bit which has Tesseract Nuget package installed. When I build it, both the 64 bit and 32 bit DLLs are copied to my bin directory. My publish package could be slimmer if it detected that my project targeted 64 bit and only copied those DLLs. Is there any way I can do this in the status quo? Or will this involve changes to this repository (and the consequential Nuget package)?

sehcheese avatar Oct 14 '19 15:10 sehcheese

I second this, and it's trivial as there's only a condition to add to Tesseract.targets:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <ItemGroup>
        <None Include="$(MSBuildThisFileDirectory)\..\x86\leptonica-1.78.0.dll" Condition="'$(Platform)' == 'x86'">
            <Link>x86\leptonica-1.78.0.dll</Link>
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <None Include="$(MSBuildThisFileDirectory)\..\x86\tesseract41.dll" Condition="'$(Platform)' == 'x86'">
            <Link>x86\tesseract41.dll</Link>
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <None Include="$(MSBuildThisFileDirectory)\..\x64\leptonica-1.78.0.dll" Condition="'$(Platform)' == 'x64'">
            <Link>x64\leptonica-1.78.0.dll</Link>
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <None Include="$(MSBuildThisFileDirectory)\..\x64\tesseract41.dll" Condition="'$(Platform)' == 'x64'">
            <Link>x64\tesseract41.dll</Link>
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
    </ItemGroup>
</Project>

cgrard avatar Feb 20 '20 10:02 cgrard