blob: 5291658f041fc831bc52a380139173b6429a98cc [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<Project InitialTargets="PreBuild" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- normalize configuration case -->
<PropertyGroup Condition="'$(CONFIGURATION)'=='Release'">
<CONFIG>Release</CONFIG>
<DebugSuffix></DebugSuffix>
<DebugSuffixDefinition></DebugSuffixDefinition>
</PropertyGroup>
<PropertyGroup Condition="'$(CONFIGURATION)'=='Debug'">
<CONFIG>Debug</CONFIG>
<DebugSuffix>_debug</DebugSuffix>
<DebugSuffixDefinition>-DDEBUG_SUFFIX=_debug</DebugSuffixDefinition>
</PropertyGroup>
<!-- Wrapper to build WTF for both win32 and x64. -->
<PropertyGroup>
<OFFICIAL_BUILD>1</OFFICIAL_BUILD>
<WebKit_Libraries>$(SRCROOT)\AppleInternal</WebKit_Libraries>
<AppleInternal>$(DSTROOT)\AppleInternal</AppleInternal>
<AppleInternalLib32>$(AppleInternal)\lib32</AppleInternalLib32>
<AppleInternalLib64>$(AppleInternal)\lib64</AppleInternalLib64>
<AppleInternalBin32>$(AppleInternal)\bin32</AppleInternalBin32>
<AppleInternalBin64>$(AppleInternal)\bin64</AppleInternalBin64>
<AppleInternal32Symbols>$(AppleInternal)\public32\sym</AppleInternal32Symbols>
<AppleInternal64Symbols>$(AppleInternal)\public64\sym</AppleInternal64Symbols>
<ProgramFilesAAS32>Program Files (x86)\Common Files\Apple\Apple Application Support</ProgramFilesAAS32>
<ProgramFilesAAS64>Program Files\Common Files\Apple\Apple Application Support</ProgramFilesAAS64>
<ConfigurationBuildDir>$(OBJROOT)\$(CONFIG)</ConfigurationBuildDir>
<OutputDirectory>$(DSTROOT)</OutputDirectory>
<CMakeCommandCommon>cmake $(SRCROOT) -DPORT=AppleWin $(DebugSuffixDefinition) -DWEBKIT_LIBRARIES_DIR=$(WebKit_Libraries.Replace('\','/')) -DCMAKE_MODULE_PATH=$(SRCROOT.Replace('\','/'))/AppleInternal/tools/cmake -DCMAKE_BINARY_DIR=$(OBJROOT.Replace('\','/'))/$(CONFIG) -DCMAKE_BUILD_TYPE=$(CONFIGURATION) -DWTF_DIR=$(SRCROOT.Replace('\','/'))</CMakeCommandCommon>
</PropertyGroup>
<!-- Prepare for build -->
<Target Name="PreBuild" BeforeTargets="Build">
<Error Text="DSTROOT property or environment variable must be defined." Condition="'$(DSTROOT)' == ''" />
<Error Text="OBJROOT property or environment variable must be defined." Condition="'$(OBJROOT)' == ''" />
<Error Text="Use /p:Configuration=Debug or /p:Configuration=Release" Condition="'$(CONFIG)' == ''" />
<MakeDir Directories="$(DSTROOT);$(OBJROOT);$(OBJROOT)/$(CONFIG);$(OBJROOT)/$(CONFIG)/build32;$(OBJROOT)/$(CONFIG)/build64" />
<Message Text="Build output -> $(OBJROOT)" />
<Message Text="Final output -> $(DSTROOT)" />
<MakeDir Directories="$(AppleInternalLib32);$(AppleInternalLib64);$(AppleInternalBin32);$(AppleInternalBin64);$(AppleInternal32Symbols);$(AppleInternal64Symbols);$(AppleInternal)\include;$(DSTROOT)\$(ProgramFilesAAS32);$(DSTROOT)\$(ProgramFilesAAS64)" />
</Target>
<!-- Build WTF Software -->
<Target Name="Build" AfterTargets="PreBuild">
<Message Text="Building $(CONFIGURATION) Solution" />
<Error Text="DSTROOT property or environment variable must be defined." Condition="'$(DSTROOT)' == ''" />
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86=1 -G &quot;Visual Studio 15 2017&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/>
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -G &quot;Visual Studio 15 2017 Win64&quot;" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build64"/>
</Target>
<Target Name="PostBuild" AfterTargets="Build">
<Error Text="DSTROOT property or environment variable must be defined." Condition="'$(DSTROOT)' == ''" />
<Message Text="Moving $(CONFIG) build results to $(DSTROOT)" />
<!-- Identify the files to copy over -->
<CreateItem Include="$(ConfigurationBuildDir)\build32\DerivedSources\ForwardingHeaders\WTF\**\*.*">
<Output TaskParameter="Include" ItemName="IncFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build32\DerivedSources\WTF\**\*.h">
<Output TaskParameter="Include" ItemName="DerivedIncFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build32\bin32\*">
<Output TaskParameter="Include" ItemName="Bin32Files" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\bin64\*">
<Output TaskParameter="Include" ItemName="Bin64Files" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build32\bin32\WTF$(DebugSuffix).dll">
<Output TaskParameter="Include" ItemName="Bin32DLLFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\bin64\WTF$(DebugSuffix).dll">
<Output TaskParameter="Include" ItemName="Bin64DLLFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build32\bin32\WTF$(DebugSuffix).pdb">
<Output TaskParameter="Include" ItemName="Bin32SymbolFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\bin64\WTF$(DebugSuffix).pdb">
<Output TaskParameter="Include" ItemName="Bin64SymbolFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build32\lib32\*">
<Output TaskParameter="Include" ItemName="Lib32Files" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\lib64\*">
<Output TaskParameter="Include" ItemName="Lib64Files" />
</CreateItem>
<Copy SourceFiles="@(IncFiles)" DestinationFiles="@(IncFiles->'$(DSTROOT)\AppleInternal\include\private\wtf\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(DerivedIncFiles)" DestinationFiles="@(DerivedIncFiles->'$(DSTROOT)\AppleInternal\include\private\wtf\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(Lib32Files)" DestinationFolder="$(AppleInternalLib32)" />
<Copy SourceFiles="@(Lib64Files)" DestinationFolder="$(AppleInternalLib64)" />
<Copy SourceFiles="@(Bin32DLLFiles)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS32)" />
<Copy SourceFiles="@(Bin32SymbolFiles)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS32)" />
<Copy SourceFiles="@(Bin64DLLFiles)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS64)" />
<Copy SourceFiles="@(Bin64SymbolFiles)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS64)" />
</Target>
</Project>