<?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) -G "Visual Studio 14 2015"" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/> | |
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/> | |
<Exec Command="$(CMakeCommandCommon) -G "Visual Studio 14 2015 Win64"" 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\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\*.pdb"> | |
<Output TaskParameter="Include" ItemName="Bin32SymbolFiles" /> | |
</CreateItem> | |
<CreateItem Include="$(ConfigurationBuildDir)\build64\bin64\*.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="@(Lib32Files)" DestinationFolder="$(AppleInternalLib32)" /> | |
<Copy SourceFiles="@(Lib64Files)" DestinationFolder="$(AppleInternalLib64)" /> | |
<Copy SourceFiles="@(Bin32Files)" DestinationFolder="$(AppleInternalBin32)" /> | |
<Copy SourceFiles="@(Bin32DLLFiles)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS32)" /> | |
<Copy SourceFiles="@(Bin32SymbolFiles)" DestinationFolder="$(AppleInternal32Symbols)" /> | |
<Copy SourceFiles="@(Bin64Files)" DestinationFolder="$(AppleInternalBin64)" /> | |
<Copy SourceFiles="@(Bin64DLLFiles)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS64)" /> | |
<Copy SourceFiles="@(Bin64SymbolFiles)" DestinationFolder="$(AppleInternal64Symbols)" /> | |
</Target> | |
</Project> |