<?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 WebCore 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> | |
<SourceSubdirectory>\Source\WebCore</SourceSubdirectory> | |
<CMakeCommandCommon>cmake $(SRCROOT)$(SourceSubdirectory) -DPORT=AppleWin $(DebugSuffixDefinition) -DINTERNAL_BUILD=1 -DWEBKIT_LIBRARIES_DIR=$(WebKit_Libraries.Replace('\','/')) -DCMAKE_MODULE_PATH=$(SRCROOT.Replace('\','/'))/AppleInternal/tools/cmake -DCMAKE_BINARY_DIR=$(OBJROOT.Replace('\','/'))/$(CONFIG) -DCMAKE_BUILD_TYPE=$(CONFIGURATION) -DWEBCORE_DIR=$(SRCROOT.Replace('\','/'))$(SourceSubdirectory.Replace('\','/')) -DPAL_DIR=$(SRCROOT.Replace('\','/'))$(SourceSubdirectory.Replace('\','/'))/PAL</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 WebCore 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 -A Win32 -G "Visual Studio 17 2022"" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/> | |
<Exec Command="msbuild Project.sln /p:Configuration=$(CONFIG)" WorkingDirectory="$(OBJROOT)/$(CONFIG)/build32"/> | |
<Exec Command="$(CMakeCommandCommon) -DWTF_CPU_X86_64=1 -A x64 -G "Visual Studio 17 2022"" 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\WebCore\**\*.*"> | |
<Output TaskParameter="Include" ItemName="IncFiles" /> | |
</CreateItem> | |
<CreateItem Include="$(ConfigurationBuildDir)\build32\DerivedSources\ForwardingHeaders\pal\**\*.*"> | |
<Output TaskParameter="Include" ItemName="IncFilesPal" /> | |
</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\*.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> | |
<Copy SourceFiles="@(IncFiles)" DestinationFiles="@(IncFiles->'$(DSTROOT)\AppleInternal\include\private\WebCore\%(RecursiveDir)%(Filename)%(Extension)')" /> | |
<Copy SourceFiles="@(IncFilesPal)" DestinationFiles="@(IncFilesPal->'$(DSTROOT)\AppleInternal\include\private\pal\%(RecursiveDir)%(Filename)%(Extension)')" /> | |
<Copy SourceFiles="@(Lib32Files)" DestinationFolder="$(AppleInternalLib32)" /> | |
<Copy SourceFiles="@(Lib64Files)" DestinationFolder="$(AppleInternalLib64)" /> | |
<Copy SourceFiles="@(Bin32Files)" DestinationFolder="$(AppleInternalBin32)" /> | |
<Copy SourceFiles="@(Bin32SymbolFiles)" DestinationFolder="$(AppleInternal32Symbols)" /> | |
<Copy SourceFiles="@(Bin32Resources)" DestinationFiles="@(Bin32Resources->'$(DSTROOT)\$(ProgramFilesAAS32)\WebKit.resources\%(RecursiveDir)%(Filename)%(Extension)')" /> | |
<Copy SourceFiles="@(Bin64Files)" DestinationFolder="$(AppleInternalBin64)" /> | |
<Copy SourceFiles="@(Bin64SymbolFiles)" DestinationFolder="$(AppleInternal64Symbols)" /> | |
<Copy SourceFiles="@(Bin64Resources)" DestinationFiles="@(Bin64Resources->'$(DSTROOT)\$(ProgramFilesAAS64)\WebKit.resources\%(RecursiveDir)%(Filename)%(Extension)')" /> | |
</Target> | |
</Project> | |