blob: 0f89bc8ea6030a996bef53e188934b61ac74dcb4 [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 JavaScriptCore 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) -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) -DJAVASCRIPTCORE_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)\JavaScriptCore.resources;$(DSTROOT)\$(ProgramFilesAAS64)\JavaScriptCore.resources" />
</Target>
<!-- Build JavaScriptCore 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\JavaScriptCore\**\*.*">
<Output TaskParameter="Include" ItemName="IncFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\include\private\JavaScriptCore\Scripts\**\*.*">
<Output TaskParameter="Include" ItemName="Scripts" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build32\DerivedSources\JavaScriptCore\inspector\**\*.*">
<Output TaskParameter="Include" ItemName="InspectorFiles" />
</CreateItem>
<CreateItem Include="$(SRCROOT)\API\*.h">
<Output TaskParameter="Include" ItemName="APIFiles" />
</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\JavaScriptCore$(DebugSuffix).pdb">
<Output TaskParameter="Include" ItemName="Bin32SymbolFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\bin64\JavaScriptCore$(DebugSuffix).pdb">
<Output TaskParameter="Include" ItemName="Bin64SymbolFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build32\bin32\JavaScriptCore$(DebugSuffix).dll">
<Output TaskParameter="Include" ItemName="Bin32DLLFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\bin64\JavaScriptCore$(DebugSuffix).dll">
<Output TaskParameter="Include" ItemName="Bin64DLLFiles" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build32\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\JavaScriptCore.resources\**\*.*">
<Output TaskParameter="Include" ItemName="Bin32Resources" />
</CreateItem>
<CreateItem Include="$(ConfigurationBuildDir)\build64\bin64\JavaScriptCore.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\JavaScriptCore\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(Scripts)" DestinationFiles="@(Scripts->'$(DSTROOT)\AppleInternal\include\private\JavaScriptCore\Scripts\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(InspectorFiles)" DestinationFiles="@(InspectorFiles->'$(DSTROOT)\AppleInternal\include\private\JavaScriptCore\inspector\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(APIFiles)" DestinationFiles="@(APIFiles->'$(DSTROOT)\AppleInternal\include\JavaScriptCore\%(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)\JavaScriptCore.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)\JavaScriptCore.resources\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
</Project>