<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <_PropertySheetDisplayName>ZeroMQ Library Common Settings</_PropertySheetDisplayName>
    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
    <RunCodeAnalysis>false</RunCodeAnalysis>
  </PropertyGroup>
  
    <!-- User Interface -->
  
  <ItemGroup Label="BuildOptionsExtension">
    <PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(ProjectName).xml" />
  </ItemGroup>

  <PropertyGroup>
    <Option-sodium>true</Option-sodium>
  </PropertyGroup>

  <!-- Configuration -->
  
  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalIncludeDirectories>$(ProjectDir)..\..\;$(ProjectDir)..\..\..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <EnablePREfast>false</EnablePREfast>
      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;FD_SETSIZE=4096;ZMQ_USE_SELECT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions Condition="'$(Option-openpgm)' == 'true'">ZMQ_HAVE_OPENPGM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions Condition="'$(Option-sodium)' == 'true'">HAVE_LIBSODIUM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions Condition="'$(Option-gssapi)' == 'true'">HAVE_LIBGSSAPI_KRB5;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'StaticLibrary'">ZMQ_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'DynamicLibrary'">DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
    <Link>
      <AdditionalDependencies>Advapi32.lib;Ws2_32.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
    <Lib Condition="'$(ConfigurationType)'=='StaticLibrary'">
      <AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions>
    </Lib>
  </ItemDefinitionGroup>

  <!-- Dependencies -->

  <ImportGroup Label="PropertySheets">
    <Import Project="$(SolutionDir)libsodium.import.props" />
  </ImportGroup>
  
  <PropertyGroup Condition="'$(DefaultLinkage)' == 'dynamic'">
    <Linkage-libsodium>dynamic</Linkage-libsodium>
  </PropertyGroup>
  <PropertyGroup Condition="'$(DefaultLinkage)' == 'ltcg'">
    <Linkage-libsodium>ltcg</Linkage-libsodium>
  </PropertyGroup>
  <PropertyGroup Condition="'$(DefaultLinkage)' == 'static'">
    <Linkage-libsodium>static</Linkage-libsodium>
  </PropertyGroup>

  <!-- Messages -->

  <Target Name="OptionInfo" BeforeTargets="PrepareForBuild">
    <Message Text="Option-openpgm    : $(Option-openpgm)" Importance="high"/>
    <Message Text="Option-sodium     : $(Option-sodium)" Importance="high"/>
    <Message Text="Option-gssapi     : $(Option-gssapi)" Importance="high"/>
  </Target>

  <Target Name="LinkageInfo" BeforeTargets="PrepareForBuild">
    <Message Text="Linkage-libsodium : $(Linkage-libsodium)" Importance="high"/>
  </Target>

</Project>
