Quellcode durchsuchen

Support Chakra.ICU on ARM (off by default)

This is the next major step in converting to ICU on all platforms. This change converts Chakra.ICU.Toolutil and Chakra.ICU.GenCCode to be built to run on the host architecture (usually x64) in order to generate icudtl_dat.obj, which is platform-agnostic and can be linked into an ARM-compatible DLL using the regular ARM linker. As a downside, it means that a clean build of Chakra.ICU takes about twice as long because ICU's common and i18n code are built twice, once for the target that gets linked to the resulting ChakraCore.dll, and once for the host that gets linked to GenCCode.exe. This is going to be a major problem for CI, however we can (hopefully) solve that problem later through caching
Jack Horton (CHAKRA) vor 8 Jahren
Ursprung
Commit
876a68d0f9

+ 22 - 12
Build/Chakra.Build.Default.props

@@ -3,18 +3,18 @@
   <Import Project="Common.Build.Default.props"/>
   <Import Condition="'$(Clang)'!=''" Project="Chakra.Build.Clang.Default.props"/>
   <PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'==''">
-      <!-- Default the installed latest Win10 SDK -->
-      <WindowsSdkInstallFolder_10 Condition="'$(WindowsSdkInstallFolder_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@InstallationFolder)</WindowsSdkInstallFolder_10>
-      <WindowsSdkInstallFolder_10 Condition="'$(WindowsSdkInstallFolder_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@InstallationFolder)</WindowsSdkInstallFolder_10>
-      <WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</WindowsTargetPlatformVersion_10>
-      <WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</WindowsTargetPlatformVersion_10>      
-      <!-- Sometimes the version in the registry has to .0 suffix, and sometimes it doesn't. Check and add it -->
-      <WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' != '' and !$(WindowsTargetPlatformVersion_10.EndsWith('.0'))">$(WindowsTargetPlatformVersion_10).0</WindowsTargetPlatformVersion_10>
-      
-      <WindowsTargetPlatformVersion>$(WindowsTargetPlatformVersion_10)</WindowsTargetPlatformVersion>
-      
-      <!-- Default back to 10.0.10240.0 if the ARM version of the Win10 SDK is not installed -->
-      <WindowsTargetPlatformVersion Condition="'$(Platform)'=='ARM' and !Exists('$(WindowsSdkInstallFolder_10)\Include\$(WindowsTargetPlatformVersion_10)\shared\ksarm.h')">10.0.10240.0</WindowsTargetPlatformVersion>
+    <!-- Default the installed latest Win10 SDK -->
+    <WindowsSdkInstallFolder_10 Condition="'$(WindowsSdkInstallFolder_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@InstallationFolder)</WindowsSdkInstallFolder_10>
+    <WindowsSdkInstallFolder_10 Condition="'$(WindowsSdkInstallFolder_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@InstallationFolder)</WindowsSdkInstallFolder_10>
+    <WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</WindowsTargetPlatformVersion_10>
+    <WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</WindowsTargetPlatformVersion_10>
+    <!-- Sometimes the version in the registry has to .0 suffix, and sometimes it doesn't. Check and add it -->
+    <WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' != '' and !$(WindowsTargetPlatformVersion_10.EndsWith('.0'))">$(WindowsTargetPlatformVersion_10).0</WindowsTargetPlatformVersion_10>
+
+    <WindowsTargetPlatformVersion>$(WindowsTargetPlatformVersion_10)</WindowsTargetPlatformVersion>
+
+    <!-- Default back to 10.0.10240.0 if the ARM version of the Win10 SDK is not installed -->
+    <WindowsTargetPlatformVersion Condition="'$(Platform)'=='ARM' and !Exists('$(WindowsSdkInstallFolder_10)\Include\$(WindowsTargetPlatformVersion_10)\shared\ksarm.h')">10.0.10240.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <PropertyGroup>
     <!-- Unless indicated otherwise, statically link the C++ Runtime into ChakraCore.dll -->
@@ -25,4 +25,14 @@
          Note that for ARM we don't need to support running on Win7, so it's fine to require Win8 as minimum. -->
     <NtTargetVersion Condition="'$(Platform)'=='ARM' or '$(Platform)'=='Arm64'">$(NtTargetVersion_Win8)</NtTargetVersion>
   </PropertyGroup>
+  <PropertyGroup>
+    <EnableIntl Condition="'$(EnableIntl)'==''">true</EnableIntl>
+    <EnableIntl Condition="'$(BuildLite)'=='true'">false</EnableIntl>
+
+    <ChakraICU Condition="'$(ChakraICU)'==''">false</ChakraICU>
+
+    <BuildChakraICUData Condition="'$(BuildChakraICUData)'=='' AND ('$(ChakraICU)'=='static' OR '$(ChakraICU)'=='shared')">true</BuildChakraICUData>
+
+    <IcuLibraryDependencies Condition="'$(ChakraICU)'=='windows'">icuuc.lib;icuin.lib</IcuLibraryDependencies>
+  </PropertyGroup>
 </Project>

+ 0 - 10
Build/Chakra.Build.props

@@ -17,16 +17,6 @@
   <PropertyGroup Condition="'$(RunCodeAnalysis)'=='' AND '$(Configuration)'=='Release'">
     <RunCodeAnalysis>$(BuildWithCodeAnalysis)</RunCodeAnalysis>
   </PropertyGroup>
-  <PropertyGroup>
-    <EnableIntl Condition="'$(EnableIntl)'==''">true</EnableIntl>
-    <EnableIntl Condition="'$(BuildLite)'=='true'">false</EnableIntl>
-
-    <ChakraICU Condition="'$(ChakraICU)'==''">false</ChakraICU>
-    <!-- ARM does not support ICU until we figure out how to link icudtXXl.dat without genccode.exe -->
-    <ChakraICU Condition="'$(Platform)'=='ARM'">false</ChakraICU>
-
-    <IcuLibraryDependencies Condition="'$(ChakraICU)'=='windows'">icuuc.lib;icuin.lib</IcuLibraryDependencies>
-  </PropertyGroup>
   <Import Condition="'$(ChakraICU)'!='false' AND exists('$(ChakraCoreRootDirectory)deps\Chakra.ICU\Chakra.ICU.props')" Project="$(ChakraCoreRootDirectory)deps\Chakra.ICU\Chakra.ICU.props" />
   <ItemDefinitionGroup>
     <ClCompile>

+ 0 - 42
Build/Chakra.Core.sln

@@ -164,12 +164,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.Data", "..\deps\
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.i18n", "..\deps\Chakra.ICU\Chakra.ICU.i18n.vcxproj", "{0494C753-5BB9-45AA-874E-E61B9922E88F}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.GenCCode", "..\deps\Chakra.ICU\Chakra.ICU.GenCCode.vcxproj", "{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.Stubdata", "..\deps\Chakra.ICU\Chakra.ICU.Stubdata.vcxproj", "{E14F373D-05A0-4259-A5E9-AFE8405FB847}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.Toolutil", "..\deps\Chakra.ICU\Chakra.ICU.Toolutil.vcxproj", "{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}"
-EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|ARM = Debug|ARM
@@ -781,24 +777,6 @@ Global
 		{0494C753-5BB9-45AA-874E-E61B9922E88F}.Test|x64.Build.0 = Test|x64
 		{0494C753-5BB9-45AA-874E-E61B9922E88F}.Test|x86.ActiveCfg = Test|Win32
 		{0494C753-5BB9-45AA-874E-E61B9922E88F}.Test|x86.Build.0 = Test|Win32
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|ARM.ActiveCfg = Debug|ARM
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|ARM.Build.0 = Debug|ARM
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|x64.ActiveCfg = Debug|x64
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|x64.Build.0 = Debug|x64
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|x86.ActiveCfg = Debug|Win32
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|x86.Build.0 = Debug|Win32
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|ARM.ActiveCfg = Release|ARM
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|ARM.Build.0 = Release|ARM
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|x64.ActiveCfg = Release|x64
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|x64.Build.0 = Release|x64
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|x86.ActiveCfg = Release|Win32
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|x86.Build.0 = Release|Win32
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|ARM.ActiveCfg = Test|ARM
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|ARM.Build.0 = Test|ARM
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|x64.ActiveCfg = Test|x64
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|x64.Build.0 = Test|x64
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|x86.ActiveCfg = Test|Win32
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|x86.Build.0 = Test|Win32
 		{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Debug|ARM.ActiveCfg = Debug|ARM
 		{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Debug|ARM.Build.0 = Debug|ARM
 		{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Debug|x64.ActiveCfg = Debug|x64
@@ -817,24 +795,6 @@ Global
 		{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Test|x64.Build.0 = Test|x64
 		{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Test|x86.ActiveCfg = Test|Win32
 		{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Test|x86.Build.0 = Test|Win32
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|ARM.ActiveCfg = Debug|ARM
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|ARM.Build.0 = Debug|ARM
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|x64.ActiveCfg = Debug|x64
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|x64.Build.0 = Debug|x64
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|x86.ActiveCfg = Debug|Win32
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|x86.Build.0 = Debug|Win32
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|ARM.ActiveCfg = Release|ARM
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|ARM.Build.0 = Release|ARM
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|x64.ActiveCfg = Release|x64
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|x64.Build.0 = Release|x64
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|x86.ActiveCfg = Release|Win32
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|x86.Build.0 = Release|Win32
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|ARM.ActiveCfg = Test|ARM
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|ARM.Build.0 = Test|ARM
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|x64.ActiveCfg = Test|x64
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|x64.Build.0 = Test|x64
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|x86.ActiveCfg = Test|Win32
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|x86.Build.0 = Test|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -881,9 +841,7 @@ Global
 		{6C6BC844-3D86-42B4-B3C4-7478487D2C38} = {158C8616-750C-4E0E-BD3D-5721D3C555E6}
 		{347824B1-7100-4EE6-8A6B-4FF64E66B0C0} = {6C6BC844-3D86-42B4-B3C4-7478487D2C38}
 		{0494C753-5BB9-45AA-874E-E61B9922E88F} = {6C6BC844-3D86-42B4-B3C4-7478487D2C38}
-		{FA9E9590-0E6C-40F9-9527-E608F2DFA76D} = {6C6BC844-3D86-42B4-B3C4-7478487D2C38}
 		{E14F373D-05A0-4259-A5E9-AFE8405FB847} = {6C6BC844-3D86-42B4-B3C4-7478487D2C38}
-		{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01} = {6C6BC844-3D86-42B4-B3C4-7478487D2C38}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {1F6CA1BC-6C01-4C82-8505-6A7690EBD556}

+ 1 - 0
deps/Chakra.ICU/Chakra.ICU.Common.vcxproj

@@ -29,6 +29,7 @@
     </ClCompile>
     <Link Condition="'$(ChakraICU)'=='shared'">
       <SubSystem>Console</SubSystem>
+      <AdditionalDependencies>%(AdditionalDependencies);advapi32.lib</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup Condition="'$(BuildLocalICU)'=='true'">

+ 3 - 8
deps/Chakra.ICU/Chakra.ICU.Data.vcxproj

@@ -19,7 +19,6 @@
   <Import Project="$(MSBuildThisFileDirectory)Chakra.ICU.Build.props" />
   <PropertyGroup>
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <GenCCodePath>$(OutBaseDir)\bin\$(PlatformPathName.ToLower())_$(Configuration.ToLower())\Chakra.ICU.GenCCode.exe</GenCCodePath>
   </PropertyGroup>
   <ItemDefinitionGroup>
     <Link Condition="'$(ChakraICU)'=='shared'">
@@ -27,16 +26,12 @@
       <NoEntryPoint>true</NoEntryPoint>
     </Link>
   </ItemDefinitionGroup>
-  <ItemGroup Condition="'$(BuildLocalICU)'=='true'">
-    <None Include="$(IntDir)icudt$(IcuVersionMajor)l_dat.obj" /> <!-- forces the automagic build system to create a lib from the obj -->
+  <ItemGroup Condition="'$(BuildChakraICUData)'=='true'">
+    <!-- TODO(jahorto): allow the data file to be trimmed or allow an alternate data file to be supplied -->
     <CustomBuild Include="$(MSBuildThisFileDirectory)source\data\in\icudt$(IcuVersionMajor)l.dat">
-      <Command>$(GenCCodePath) --object --destdir $(IntDir) --entrypoint icudt$(IcuVersionMajor) $(IcuSourceDirectory)\data\in\icudt$(IcuVersionMajor)l.dat</Command>
+      <Command>cmd /c "powershell $(ChakraCoreRootDirectory)\tools\icu\create_data_obj.ps1 -d $(MSBuildThisFileDirectory)icu\source\data\in\icudt$(IcuVersionMajor)l.dat -p $(Platform) -c $(Configuration) -m '$(MSBuildBinPath)\msbuild.exe' -i $(IntDir) -v $(IcuVersionMajor)"</Command>
       <Outputs>$(IntDir)icudt$(IcuVersionMajor)l_dat.obj</Outputs>
     </CustomBuild>
-    <ProjectReference Include="$(MSBuildThisFileDirectory)Chakra.ICU.GenCCode.vcxproj">
-      <Project>{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
   </ItemGroup>
   <Import Project="$(BuildConfigPropsPath)Chakra.Build.targets" Condition="exists('$(BuildConfigPropsPath)Chakra.Build.targets')" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+ 0 - 12
deps/Chakra.ICU/Chakra.ICU.GenCCode.vcxproj

@@ -36,22 +36,10 @@
   <ItemGroup Condition="'$(BuildLocalICU)'=='true'">
     <ClCompile Include="$(IcuGenccodeSources)" />
     <ClInclude Include="$(IcuGenccodeHeaders)" />
-    <ProjectReference Include="$(MSBuildThisFileDirectory)Chakra.ICU.Common.vcxproj">
-      <Project>{EE2A3111-4D85-427C-B0AB-E6B0EA7FFB44}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
-    <ProjectReference Include="$(MSBuildThisFileDirectory)Chakra.ICU.i18n.vcxproj">
-      <Project>{0494C753-5BB9-45AA-874E-E61B9922E88F}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
     <ProjectReference Include="$(MSBuildThisFileDirectory)Chakra.ICU.Toolutil.vcxproj">
       <Project>{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
-    <ProjectReference Include="$(MSBuildThisFileDirectory)Chakra.ICU.Stubdata.vcxproj">
-      <Project>{E14F373D-05A0-4259-A5E9-AFE8405FB847}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
   </ItemGroup>
   <Import Project="$(BuildConfigPropsPath)Chakra.Build.targets" Condition="exists('$(BuildConfigPropsPath)Chakra.Build.targets')" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+ 2 - 2
deps/Chakra.ICU/Chakra.ICU.Stubdata.vcxproj

@@ -35,8 +35,8 @@
     <Link Condition="'$(ChakraICU)'=='shared'">
       <SubSystem>Console</SubSystem>
       <!-- Make Chakra.ICU.Stubdata pretend like its Chakra.ICU.Data for linking purposes -->
-      <OutputFile>$(OutDir)\Chakra.ICU.Data.dll</OutputFile>
-      <ImportLibrary>$(OutDir)\Chakra.ICU.Data.lib</ImportLibrary>
+      <OutputFile>$(OutDir)\Chakra.ICU.Stubdata\Chakra.ICU.Data.dll</OutputFile>
+      <ImportLibrary>$(OutDir)\Chakra.ICU.Stubdata\Chakra.ICU.Data.lib</ImportLibrary>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup Condition="'$(BuildLocalICU)'=='true'">

+ 23 - 1
deps/Chakra.ICU/Chakra.ICU.Toolutil.vcxproj

@@ -1,4 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
+
+<!-- Chakra.ICU.Toolutil -->
+<!--
+  This project contains all of the library code for ICU tools such as GenCCode.
+  GenCCode produces a platform-agnostic object file, but must be built in the host architecture.
+  As a result, GenCCode.vcxproj and this project are built separately from the rest
+ -->
+
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Import Condition="'$(ChakraBuildPathImported)'!='true'" Project="$(SolutionDir)Chakra.Build.Paths.props" />
   <Import Project="$(BuildConfigPropsPath)Chakra.Build.ProjectConfiguration.props" />
@@ -23,7 +31,11 @@
     <ClCompile>
       <PreprocessorDefinitions>
         %(PreprocessorDefinitions);
-        U_TOOLUTIL_IMPLEMENTATION=1
+        U_COMBINED_IMPLEMENTATION=1;
+        U_TOOLUTIL_IMPLEMENTATION=1;
+        U_STUBDATA_IMPLEMENTATION=1;
+        U_COMMON_IMPLEMENTATION=1;
+        U_I18N_IMPLEMENTATION=1
       </PreprocessorDefinitions>
 
       <AdditionalIncludeDirectories>
@@ -31,11 +43,21 @@
         $(IcuSourceDirectory)\common;
         $(IcuSourceDirectory)\i18n
       </AdditionalIncludeDirectories>
+
+      <!-- Some ICU files use embedded UTF-8 -->
+      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemGroup Condition="'$(BuildLocalICU)'=='true'">
     <ClCompile Include="$(IcuToolutilSources)" />
+    <ClCompile Include="$(IcuCommonSources)" />
+    <ClCompile Include="$(IcuI18nSources)" />
+    <ClCompile Include="$(IcuStubdataSources)" />
+
     <ClInclude Include="$(IcuToolutilHeaders)" />
+    <ClInclude Include="$(IcuCommonHeaders)" />
+    <ClInclude Include="$(IcuI18nHeaders)" />
+    <ClInclude Include="$(IcuStubdataHeaders)" />
   </ItemGroup>
   <Import Project="$(BuildConfigPropsPath)Chakra.Build.targets" Condition="exists('$(BuildConfigPropsPath)Chakra.Build.targets')" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+ 0 - 0
tools/configure_icu.py → tools/icu/configure.py


+ 67 - 0
tools/icu/create_data_obj.ps1

@@ -0,0 +1,67 @@
+# -------------------------------------------------------------------------------------------------------
+# Copyright (C) Microsoft. All rights reserved.
+# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+# -------------------------------------------------------------------------------------------------------
+
+# This file is called as a CustomBuild step from Chakra.ICU.Data.vcxproj.
+#
+# To generate the data file, we need to build GenCCode.exe for the host platform. We can then run
+# GenCCode.exe --object to produce a platform-agnostic object file, which the linking step of
+# Chakra.ICU.Data should be able to link into a DLL for the target platform.
+
+param(
+    [parameter(Mandatory=$true)]
+    [alias("d")]
+    [string]$DataFile,
+
+    [parameter(Mandatory=$true)]
+    [alias("p")]
+    [string]$TargetPlatform,
+
+    [parameter(Mandatory=$true)]
+    [alias("c")]
+    [string]$TargetConfiguration,
+
+    [parameter(Mandatory=$true)]
+    [alias("m")]
+    [string]$MSBuildPath,
+
+    [parameter(Mandatory=$true)]
+    [alias("i")]
+    [string]$IntDir,
+
+    [parameter(Mandatory=$true)]
+    [alias("v")]
+    [string]$IcuVersionMajor
+)
+
+$scriptRoot=Split-Path -Path $MyInvocation.MyCommand.Path
+
+# This gets the actual platform of the host, as opposed to the %PROCESSOR_ARCHITECTURE% environment variable which
+# changes depending on if 32 and 64 bit binaries are calling each other
+$hostPlatform=(Get-ItemProperty "HKLM:\System\CurrentControlSet\Control\Session Manager\Environment").PROCESSOR_ARCHITECTURE
+if ($hostPlatform -eq "AMD64") {
+    $hostPlatform="x64"
+} elseif ($hostPlatform -eq "X86") {
+    $hostPlatform="x86"
+}
+
+Write-Host DataFile: $DataFile
+Write-Host TargetPlatform: $TargetPlatform
+Write-Host MSBuildPath: $MSBuildPath
+Write-Host HostPlatform: $hostPlatform
+
+$sep="_"
+$genccode="$scriptRoot\..\..\Build\VcBuild\bin\$hostPlatform" + "_release\Chakra.ICU.GenCCode.exe"
+
+if (-not (Test-Path $genccode)) {
+    Write-Host
+    Write-Host Could not find $genccode, building from scratch
+    cmd /c "$MSBuildPath" /nologo "$scriptRoot\..\..\deps\Chakra.ICU\Chakra.ICU.GenCCode.vcxproj" "/p:Platform=$hostPlatform;Configuration=Release;SolutionDir=$scriptRoot\..\..\Build\"
+}
+
+Write-Host
+Write-Host Building object file
+cmd /c "$genccode" --object --destdir $IntDir --entrypoint icudt$IcuVersionMajor $DataFile
+
+Write-Host "Object file created in $IntDir"