<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <LinkIncremental Condition="'$(Configuration)'=='Debug'">true</LinkIncremental>
    <LinkIncremental Condition="'$(Configuration)'=='Release'">false</LinkIncremental>
  </PropertyGroup>
  <ItemDefinitionGroup>
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
      <FloatingPointModel>Fast</FloatingPointModel>
      <AdditionalIncludeDirectories>$(SolutionDir)\..\..\src;$(SolutionDir)\..\..\src\bullet;$(FlexIncludes);$(BtPhysIncludes);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <AdditionalIncludeDirectories Condition="'$(Platform)'=='Win32'">$(GlIncludes);$(SdlIncludes);$(D3d9Includes);$(XinputIncludes);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <AdditionalIncludeDirectories Condition="'$(Platform)'=='x64'">$(GlIncludes);$(SdlIncludes);$(D3d9Includes);$(XinputIncludes);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions Condition="'$(Platform)'=='Win32'">WIN32;$(Win32Defines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions Condition="'$(Platform)'=='x64'">WIN32;$(Win32Defines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions Condition="'$(Platform)'=='Xbox 360'">_XBOX;$(XboxDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions Condition="'$(Platform)'=='PS3'">$(Ps3Defines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <BufferSecurityCheck Condition="'$(Platform)'=='Xbox 360'">false</BufferSecurityCheck>
    </ClCompile>
    <ClCompile Condition="'$(Configuration)'=='Debug'">
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <Optimization>Disabled</Optimization>
      <RuntimeLibrary Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">MultiThreadedDebugDLL</RuntimeLibrary>
      <RuntimeLibrary Condition="'$(Platform)'=='Xbox 360'">MultiThreadedDebug</RuntimeLibrary>
      <PreprocessorDefinitions>_DEBUG;LOL_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
    <ClCompile Condition="'$(Configuration)'=='Release'">
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <!-- For Microsoft tools -->
      <Optimization>MaxSpeed</Optimization>
      <!-- For PlayStation tools -->
      <OptimizationLevel>Level2</OptimizationLevel>

      <RuntimeLibrary Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">MultiThreadedDLL</RuntimeLibrary>
      <RuntimeLibrary Condition="'$(Platform)'=='Xbox 360'">MultiThreaded</RuntimeLibrary>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
      <PreprocessorDefinitions>NDEBUG;LOL_RELEASE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>

    <Link>
      <!-- FIXME: not for the static library! -->
      <AdditionalDependencies Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;$(SdlDeps);$(GdiDeps);$(XinputDeps);%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalDependencies Condition="'$(UseOpenGL)'=='true' And ('$(Platform)'=='Win32' Or '$(Platform)'=='x64')">$(GlDeps);%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalDependencies Condition="'$(UseOpenGL)'=='false' And ('$(Platform)'=='Win32' Or '$(Platform)'=='x64')">$(D3d9Deps);%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">$(SdlLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">$(GlLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">$(D3d9Libs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">$(XinputLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">xapilibd.lib;d3d9d.lib;d3dx9d.lib;xgraphicsd.lib;xboxkrnl.lib;xnetd.lib;xaudiod2.lib;xactd3.lib;x3daudiod.lib;xmcored.lib;xbdm.lib;vcompd.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">xapilib.lib;d3d9.lib;d3dx9.lib;xgraphics.lib;xboxkrnl.lib;xnet.lib;xaudio2.lib;xact3.lib;x3daudio.lib;xmcore.lib;vcomp.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories Condition="'$(Platform)'=='PS3'">$(Ps3Libs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalLibraryDirectories Condition="'$(Platform)'=='PS3'">$(GlLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalDependencies Condition="'$(Platform)'=='PS3'">$(Ps3Deps);%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalDependencies Condition="'$(Platform)'=='PS3'">$(GlDeps);%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
    <Link Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">
      <SubSystem>Windows</SubSystem>
    </Link>
    <Link Condition="'$(Configuration)'=='Debug'">
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
    <Link Condition="'$(Configuration)'=='Release'">
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <OptimizeReferences>true</OptimizeReferences>
    </Link>

    <!-- FIXME: not for the static library! -->
    <PostBuildEvent Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">
      <Command>
        set A=$(SdlLibs)
        :again
        for /f "tokens=1* delims=;" %%I in ("%A%") do (
          if not "%%I" == "" xcopy /y /c /d "%%I"\*.dll "$(TargetDir)" &amp;&amp; set A=%%J
          if not "%%I" == "" goto again
        )
      </Command>
    </PostBuildEvent>

    <!-- FIXME: not for the static library! -->
    <Deploy Condition="'$(Platform)'=='Xbox 360'">
      <DeploymentType>CopyToHardDrive</DeploymentType>
    </Deploy>

  </ItemDefinitionGroup>
</Project>
