blob: 44ef53162b0847ba2a53b992df26b902b97bfe0c [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 WebKitLegacy 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) -DWEBKIT_DIR=$(SRCROOT.Replace('\','/')) -DWEBKITLEGACY_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)' == ''" />
<Message Text="Copying necessary headers to $(ConfigurationBuildDir)" />
<MakeDir Directories="$(DSTROOT);$(OBJROOT);$(OBJROOT)/$(CONFIG);$(ConfigurationBuildDir)\include\private;$(OBJROOT)/$(CONFIG)/build32;$(OBJROOT)/$(CONFIG)/build64" />
<CreateItem Include="$(WebKit_Libraries)\include\private\**\*.*">
<Output TaskParameter="Include" ItemName="PrivateIncFiles" />
</CreateItem>
<Copy SourceFiles="@(PrivateIncFiles)" DestinationFiles="@(PrivateIncFiles->'$(ConfigurationBuildDir)\include\private\%(RecursiveDir)%(Filename)%(Extension)')" />
<Message Text="Build output -> $(OBJROOT)" />
<Message Text="Final output -> $(DSTROOT)" />
<MakeDir Directories="$(AppleInternalLib32);$(AppleInternalLib64);$(AppleInternalBin32);$(AppleInternalBin64);$(AppleInternal32Symbols);$(AppleInternal64Symbols);$(AppleInternal)\include;$(DSTROOT)\$(ProgramFilesAAS32);$(DSTROOT)\$(ProgramFilesAAS64)" />
<MakeDir Directories="$(DSTROOT)\$(ProgramFilesAAS32)\WebKit.resources;$(DSTROOT)\$(ProgramFilesAAS64)\WebKit.resources" />
</Target>
<!-- Build WebKitLegacy 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\WebKitLegacy\**\*.*">
<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\WebKit$(DebugSuffix).dll">
<Output TaskParameter="Include" ItemName="Bin32DLLFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\bin64\WebKit$(DebugSuffix).dll">
<Output TaskParameter="Include" ItemName="Bin64DLLFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\bin32\*.resources">
<Output TaskParameter="Include" ItemName="Bin32ResourceFolders" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\bin64\*.resources">
<Output TaskParameter="Include" ItemName="Bin64ResourceFolders" />
</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\bin32\WebKit.resources\**\*.*">
<Output TaskParameter="Include" ItemName="Bin32Resources" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\bin64\WebKit.resources\**\*.*">
<Output TaskParameter="Include" ItemName="Bin64Resources" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build32\lib32\*">
<Output TaskParameter="Include" ItemName="Lib32Files" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\lib64\*">
<Output TaskParameter="Include" ItemName="Lib64Files" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\obj32\WebKit\DerivedSources\**\*.*">
<Output TaskParameter="Include" ItemName="Derived32Sources" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build32\obj64\WebKit\DerivedSources\**\*.*">
<Output TaskParameter="Include" ItemName="Derived64Sources" />
</CreateItem>
<Copy SourceFiles="@(IncFiles)" DestinationFiles="@(IncFiles->'$(DSTROOT)\AppleInternal\include\WebKit\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(Lib32Files)" DestinationFolder="$(AppleInternalLib32)" />
<Copy SourceFiles="@(Lib64Files)" DestinationFolder="$(AppleInternalLib64)" />
<Copy SourceFiles="@(Bin32DLLFiles)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS32)" />
<Copy SourceFiles="@(Bin32ResourceFolders)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS32)" />
<Copy SourceFiles="@(Bin32SymbolFiles)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS32)" />
<Copy SourceFiles="@(Bin32Resources)" DestinationFiles="@(Bin32Resources->'$(DSTROOT)\$(ProgramFilesAAS32)\WebKit.resources\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(Bin64DLLFiles)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS64)" />
<Copy SourceFiles="@(Bin64ResourceFolders)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS64)" />
<Copy SourceFiles="@(Bin64SymbolFiles)" DestinationFolder="$(DSTROOT)\$(ProgramFilesAAS64)" />
<Copy SourceFiles="@(Bin64Resources)" DestinationFiles="@(Bin64Resources->'$(DSTROOT)\$(ProgramFilesAAS64)\WebKit.resources\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
</Project>