Use libiconv from Nuget for Windows build.

Explicitly declare const char* because of MSVC.
MIME-14
Thomas 3 years ago
parent 7f1bff7ebf
commit 6fb2a8410f

@ -108,8 +108,10 @@
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Lib>
<AdditionalLibraryDirectories>C:\msys64\mingw32\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>libiconv.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<AdditionalDependencies>
</AdditionalDependencies>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
<ProjectReference>
@ -152,8 +154,10 @@
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Lib>
<AdditionalDependencies>libiconv.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\msys64\mingw32\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>
</AdditionalDependencies>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
</Lib>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
@ -231,11 +235,13 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\packages\boost.1.71.0.0\build\boost.targets" Condition="Exists('..\..\packages\boost.1.71.0.0\build\boost.targets')" />
<Import Project="..\..\packages\libiconv.lib.1.16.0.6\build\native\libiconv.lib.targets" Condition="Exists('..\..\packages\libiconv.lib.1.16.0.6\build\native\libiconv.lib.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\boost.1.71.0.0\build\boost.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\boost.1.71.0.0\build\boost.targets'))" />
<Error Condition="!Exists('..\..\packages\libiconv.lib.1.16.0.6\build\native\libiconv.lib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\libiconv.lib.1.16.0.6\build\native\libiconv.lib.targets'))" />
</Target>
</Project>

@ -1412,36 +1412,6 @@
<ClCompile Include="..\src\to_utf8.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\unittest_address.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\unittest_base64.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\unittest_mime.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\unittest_nfc.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\unittest_qp.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\unittest_rule.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\unittest_stringcase.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\unittest_subject.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\unittest_timestamp.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\unittest_toutf8.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\base64.cc">
<Filter>Source Files</Filter>
</ClCompile>

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="boost" version="1.71.0.0" targetFramework="native" />
<package id="libiconv.lib" version="1.16.0.6" targetFramework="native" />
</packages>

@ -94,7 +94,7 @@ std::string to_utf8_iconv(const sv& charset, sv s)
ret.reserve(s.size());
char buffer[ IconvBufSize ];
char* in_p = const_cast<char*>(s.data()); // iconv sucks.
const char* in_p = const_cast<char*>(s.data()); // iconv sucks.
size_t in_len = s.size();
LOG << "to_utf8_iconv(): in_len=" << in_len << ". BufSize=" << IconvBufSize << "\n";

Loading…
Cancel
Save