Browse Source

Add Windows project files and two fixes

- make in_p const
- adjust path of slurp.hh for Windows builds

TODO: implement Windows alternatives for random, timegm and tm.tm_zone
build-windows
Thomas 3 years ago
parent
commit
7fe9868f39
4 changed files with 347 additions and 1 deletions
  1. +199
    -0
      build-windows/pEpMIME.vcxproj
  2. +143
    -0
      build-windows/pEpMIME.vcxproj.filters
  3. +1
    -1
      src/to_utf8.cc
  4. +4
    -0
      src/unittest_mime.cc

+ 199
- 0
build-windows/pEpMIME.vcxproj View File

@ -0,0 +1,199 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{A6FA4848-3D26-44A3-A305-EFE6D1CB57DF}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>pEpMIME</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)Dependencies;$(SolutionDir)Dependencies\libiconv\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)Dependencies;$(SolutionDir)Dependencies\libiconv\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\src\base64.hh" />
<ClInclude Include="..\src\base64.hxx" />
<ClInclude Include="..\src\bodyparser.hh" />
<ClInclude Include="..\src\headerparser.hh" />
<ClInclude Include="..\src\nfc.hh" />
<ClInclude Include="..\src\nfc_sets.hh" />
<ClInclude Include="..\src\nulllogger.hh" />
<ClInclude Include="..\src\parse_address.hh" />
<ClInclude Include="..\src\parse_timestamp.hh" />
<ClInclude Include="..\src\pEpMIME.hh" />
<ClInclude Include="..\src\pEpMIME_internal.hh" />
<ClInclude Include="..\src\quoted_printable.hh" />
<ClInclude Include="..\src\quoted_printable.hxx" />
<ClInclude Include="..\src\rules.hh" />
<ClInclude Include="..\src\string_case.hh" />
<ClInclude Include="..\src\to_utf8.hh" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\base64.cc" />
<ClCompile Include="..\src\bodyparser.cc" />
<ClCompile Include="..\src\fuzz.cc" />
<ClCompile Include="..\src\headerparser.cc" />
<ClCompile Include="..\src\nfc.cc" />
<ClCompile Include="..\src\nfc_sets.cc" />
<ClCompile Include="..\src\nulllogger.cc" />
<ClCompile Include="..\src\parse_address.cc" />
<ClCompile Include="..\src\parse_timestamp.cc" />
<ClCompile Include="..\src\pEpMIME.cc" />
<ClCompile Include="..\src\pEpMIME_internal.cc" />
<ClCompile Include="..\src\quoted_printable.cc" />
<ClCompile Include="..\src\rules.cc" />
<ClCompile Include="..\src\to_utf8.cc" />
<ClCompile Include="..\src\unittest_address.cc" />
<ClCompile Include="..\src\unittest_mime.cc" />
<ClCompile Include="..\src\unittest_nfc.cc" />
<ClCompile Include="..\src\unittest_rule.cc" />
<ClCompile Include="..\src\unittest_stringcase.cc" />
<ClCompile Include="..\src\unittest_subject.cc" />
<ClCompile Include="..\src\unittest_timestamp.cc" />
<ClCompile Include="..\src\unittest_toutf8.cc" />
</ItemGroup>
<ItemGroup>
<None Include="..\src\scripts\gen_sets.sh" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

+ 143
- 0
build-windows/pEpMIME.vcxproj.filters View File

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="scripts">
<UniqueIdentifier>{1c937d85-9b48-46c0-8251-f317745f7b0a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\base64.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\base64.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\bodyparser.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\headerparser.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\nfc.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\nfc_sets.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\nulllogger.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\parse_address.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\parse_timestamp.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\pEpMIME.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\pEpMIME_internal.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\quoted_printable.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\quoted_printable.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\rules.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\string_case.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\to_utf8.hh">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\base64.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\bodyparser.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\fuzz.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\headerparser.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\nfc.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\nfc_sets.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\nulllogger.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\parse_address.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\parse_timestamp.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\pEpMIME.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\pEpMIME_internal.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\quoted_printable.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\rules.cc">
<Filter>Source Files</Filter>
</ClCompile>
<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_mime.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\unittest_nfc.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>
</ItemGroup>
<ItemGroup>
<None Include="..\src\scripts\gen_sets.sh">
<Filter>scripts</Filter>
</None>
</ItemGroup>
</Project>

+ 1
- 1
src/to_utf8.cc View File

@ -83,7 +83,7 @@ std::string to_utf8_iconv(const sv& charset, const std::string& s)
ret.reserve(s.size());
char buffer[ IconvBufSize ];
char* in_p = const_cast<char*>(s.c_str()); // iconv sucks.
const char* in_p = const_cast<char*>(s.c_str()); // iconv sucks.
size_t in_len = s.size();
while(in_len)


+ 4
- 0
src/unittest_mime.cc View File

@ -1,6 +1,10 @@
#include "pEpMIME.hh"
#include "base64.hh"
#ifdef WIN32
#include <libpEpAdapter/slurp.hh>
#else
#include <pEp/slurp.hh>
#endif
#include <iostream>
#include <gtest/gtest.h>


Loading…
Cancel
Save