Skip to content

Commit 876a68d

Browse files
committed
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
1 parent 11bc046 commit 876a68d

10 files changed

Lines changed: 118 additions & 87 deletions

Build/Chakra.Build.Default.props

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
<Import Project="Common.Build.Default.props"/>
44
<Import Condition="'$(Clang)'!=''" Project="Chakra.Build.Clang.Default.props"/>
55
<PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'==''">
6-
<!-- Default the installed latest Win10 SDK -->
7-
<WindowsSdkInstallFolder_10 Condition="'$(WindowsSdkInstallFolder_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@InstallationFolder)</WindowsSdkInstallFolder_10>
8-
<WindowsSdkInstallFolder_10 Condition="'$(WindowsSdkInstallFolder_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@InstallationFolder)</WindowsSdkInstallFolder_10>
9-
<WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</WindowsTargetPlatformVersion_10>
10-
<WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</WindowsTargetPlatformVersion_10>
11-
<!-- Sometimes the version in the registry has to .0 suffix, and sometimes it doesn't. Check and add it -->
12-
<WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' != '' and !$(WindowsTargetPlatformVersion_10.EndsWith('.0'))">$(WindowsTargetPlatformVersion_10).0</WindowsTargetPlatformVersion_10>
13-
14-
<WindowsTargetPlatformVersion>$(WindowsTargetPlatformVersion_10)</WindowsTargetPlatformVersion>
15-
16-
<!-- Default back to 10.0.10240.0 if the ARM version of the Win10 SDK is not installed -->
17-
<WindowsTargetPlatformVersion Condition="'$(Platform)'=='ARM' and !Exists('$(WindowsSdkInstallFolder_10)\Include\$(WindowsTargetPlatformVersion_10)\shared\ksarm.h')">10.0.10240.0</WindowsTargetPlatformVersion>
6+
<!-- Default the installed latest Win10 SDK -->
7+
<WindowsSdkInstallFolder_10 Condition="'$(WindowsSdkInstallFolder_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@InstallationFolder)</WindowsSdkInstallFolder_10>
8+
<WindowsSdkInstallFolder_10 Condition="'$(WindowsSdkInstallFolder_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@InstallationFolder)</WindowsSdkInstallFolder_10>
9+
<WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</WindowsTargetPlatformVersion_10>
10+
<WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</WindowsTargetPlatformVersion_10>
11+
<!-- Sometimes the version in the registry has to .0 suffix, and sometimes it doesn't. Check and add it -->
12+
<WindowsTargetPlatformVersion_10 Condition="'$(WindowsTargetPlatformVersion_10)' != '' and !$(WindowsTargetPlatformVersion_10.EndsWith('.0'))">$(WindowsTargetPlatformVersion_10).0</WindowsTargetPlatformVersion_10>
13+
14+
<WindowsTargetPlatformVersion>$(WindowsTargetPlatformVersion_10)</WindowsTargetPlatformVersion>
15+
16+
<!-- Default back to 10.0.10240.0 if the ARM version of the Win10 SDK is not installed -->
17+
<WindowsTargetPlatformVersion Condition="'$(Platform)'=='ARM' and !Exists('$(WindowsSdkInstallFolder_10)\Include\$(WindowsTargetPlatformVersion_10)\shared\ksarm.h')">10.0.10240.0</WindowsTargetPlatformVersion>
1818
</PropertyGroup>
1919
<PropertyGroup>
2020
<!-- Unless indicated otherwise, statically link the C++ Runtime into ChakraCore.dll -->
@@ -25,4 +25,14 @@
2525
Note that for ARM we don't need to support running on Win7, so it's fine to require Win8 as minimum. -->
2626
<NtTargetVersion Condition="'$(Platform)'=='ARM' or '$(Platform)'=='Arm64'">$(NtTargetVersion_Win8)</NtTargetVersion>
2727
</PropertyGroup>
28+
<PropertyGroup>
29+
<EnableIntl Condition="'$(EnableIntl)'==''">true</EnableIntl>
30+
<EnableIntl Condition="'$(BuildLite)'=='true'">false</EnableIntl>
31+
32+
<ChakraICU Condition="'$(ChakraICU)'==''">false</ChakraICU>
33+
34+
<BuildChakraICUData Condition="'$(BuildChakraICUData)'=='' AND ('$(ChakraICU)'=='static' OR '$(ChakraICU)'=='shared')">true</BuildChakraICUData>
35+
36+
<IcuLibraryDependencies Condition="'$(ChakraICU)'=='windows'">icuuc.lib;icuin.lib</IcuLibraryDependencies>
37+
</PropertyGroup>
2838
</Project>

Build/Chakra.Build.props

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@
1717
<PropertyGroup Condition="'$(RunCodeAnalysis)'=='' AND '$(Configuration)'=='Release'">
1818
<RunCodeAnalysis>$(BuildWithCodeAnalysis)</RunCodeAnalysis>
1919
</PropertyGroup>
20-
<PropertyGroup>
21-
<EnableIntl Condition="'$(EnableIntl)'==''">true</EnableIntl>
22-
<EnableIntl Condition="'$(BuildLite)'=='true'">false</EnableIntl>
23-
24-
<ChakraICU Condition="'$(ChakraICU)'==''">false</ChakraICU>
25-
<!-- ARM does not support ICU until we figure out how to link icudtXXl.dat without genccode.exe -->
26-
<ChakraICU Condition="'$(Platform)'=='ARM'">false</ChakraICU>
27-
28-
<IcuLibraryDependencies Condition="'$(ChakraICU)'=='windows'">icuuc.lib;icuin.lib</IcuLibraryDependencies>
29-
</PropertyGroup>
3020
<Import Condition="'$(ChakraICU)'!='false' AND exists('$(ChakraCoreRootDirectory)deps\Chakra.ICU\Chakra.ICU.props')" Project="$(ChakraCoreRootDirectory)deps\Chakra.ICU\Chakra.ICU.props" />
3121
<ItemDefinitionGroup>
3222
<ClCompile>

Build/Chakra.Core.sln

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.Data", "..\deps\
164164
EndProject
165165
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.i18n", "..\deps\Chakra.ICU\Chakra.ICU.i18n.vcxproj", "{0494C753-5BB9-45AA-874E-E61B9922E88F}"
166166
EndProject
167-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.GenCCode", "..\deps\Chakra.ICU\Chakra.ICU.GenCCode.vcxproj", "{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}"
168-
EndProject
169167
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.Stubdata", "..\deps\Chakra.ICU\Chakra.ICU.Stubdata.vcxproj", "{E14F373D-05A0-4259-A5E9-AFE8405FB847}"
170168
EndProject
171-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.Toolutil", "..\deps\Chakra.ICU\Chakra.ICU.Toolutil.vcxproj", "{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}"
172-
EndProject
173169
Global
174170
GlobalSection(SolutionConfigurationPlatforms) = preSolution
175171
Debug|ARM = Debug|ARM
@@ -781,24 +777,6 @@ Global
781777
{0494C753-5BB9-45AA-874E-E61B9922E88F}.Test|x64.Build.0 = Test|x64
782778
{0494C753-5BB9-45AA-874E-E61B9922E88F}.Test|x86.ActiveCfg = Test|Win32
783779
{0494C753-5BB9-45AA-874E-E61B9922E88F}.Test|x86.Build.0 = Test|Win32
784-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|ARM.ActiveCfg = Debug|ARM
785-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|ARM.Build.0 = Debug|ARM
786-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|x64.ActiveCfg = Debug|x64
787-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|x64.Build.0 = Debug|x64
788-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|x86.ActiveCfg = Debug|Win32
789-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Debug|x86.Build.0 = Debug|Win32
790-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|ARM.ActiveCfg = Release|ARM
791-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|ARM.Build.0 = Release|ARM
792-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|x64.ActiveCfg = Release|x64
793-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|x64.Build.0 = Release|x64
794-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|x86.ActiveCfg = Release|Win32
795-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Release|x86.Build.0 = Release|Win32
796-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|ARM.ActiveCfg = Test|ARM
797-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|ARM.Build.0 = Test|ARM
798-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|x64.ActiveCfg = Test|x64
799-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|x64.Build.0 = Test|x64
800-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|x86.ActiveCfg = Test|Win32
801-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}.Test|x86.Build.0 = Test|Win32
802780
{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Debug|ARM.ActiveCfg = Debug|ARM
803781
{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Debug|ARM.Build.0 = Debug|ARM
804782
{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Debug|x64.ActiveCfg = Debug|x64
@@ -817,24 +795,6 @@ Global
817795
{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Test|x64.Build.0 = Test|x64
818796
{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Test|x86.ActiveCfg = Test|Win32
819797
{E14F373D-05A0-4259-A5E9-AFE8405FB847}.Test|x86.Build.0 = Test|Win32
820-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|ARM.ActiveCfg = Debug|ARM
821-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|ARM.Build.0 = Debug|ARM
822-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|x64.ActiveCfg = Debug|x64
823-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|x64.Build.0 = Debug|x64
824-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|x86.ActiveCfg = Debug|Win32
825-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Debug|x86.Build.0 = Debug|Win32
826-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|ARM.ActiveCfg = Release|ARM
827-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|ARM.Build.0 = Release|ARM
828-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|x64.ActiveCfg = Release|x64
829-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|x64.Build.0 = Release|x64
830-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|x86.ActiveCfg = Release|Win32
831-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Release|x86.Build.0 = Release|Win32
832-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|ARM.ActiveCfg = Test|ARM
833-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|ARM.Build.0 = Test|ARM
834-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|x64.ActiveCfg = Test|x64
835-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|x64.Build.0 = Test|x64
836-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|x86.ActiveCfg = Test|Win32
837-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}.Test|x86.Build.0 = Test|Win32
838798
EndGlobalSection
839799
GlobalSection(SolutionProperties) = preSolution
840800
HideSolutionNode = FALSE
@@ -881,9 +841,7 @@ Global
881841
{6C6BC844-3D86-42B4-B3C4-7478487D2C38} = {158C8616-750C-4E0E-BD3D-5721D3C555E6}
882842
{347824B1-7100-4EE6-8A6B-4FF64E66B0C0} = {6C6BC844-3D86-42B4-B3C4-7478487D2C38}
883843
{0494C753-5BB9-45AA-874E-E61B9922E88F} = {6C6BC844-3D86-42B4-B3C4-7478487D2C38}
884-
{FA9E9590-0E6C-40F9-9527-E608F2DFA76D} = {6C6BC844-3D86-42B4-B3C4-7478487D2C38}
885844
{E14F373D-05A0-4259-A5E9-AFE8405FB847} = {6C6BC844-3D86-42B4-B3C4-7478487D2C38}
886-
{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01} = {6C6BC844-3D86-42B4-B3C4-7478487D2C38}
887845
EndGlobalSection
888846
GlobalSection(ExtensibilityGlobals) = postSolution
889847
SolutionGuid = {1F6CA1BC-6C01-4C82-8505-6A7690EBD556}

deps/Chakra.ICU/Chakra.ICU.Common.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
</ClCompile>
3030
<Link Condition="'$(ChakraICU)'=='shared'">
3131
<SubSystem>Console</SubSystem>
32+
<AdditionalDependencies>%(AdditionalDependencies);advapi32.lib</AdditionalDependencies>
3233
</Link>
3334
</ItemDefinitionGroup>
3435
<ItemGroup Condition="'$(BuildLocalICU)'=='true'">

deps/Chakra.ICU/Chakra.ICU.Data.vcxproj

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,19 @@
1919
<Import Project="$(MSBuildThisFileDirectory)Chakra.ICU.Build.props" />
2020
<PropertyGroup>
2121
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
22-
<GenCCodePath>$(OutBaseDir)\bin\$(PlatformPathName.ToLower())_$(Configuration.ToLower())\Chakra.ICU.GenCCode.exe</GenCCodePath>
2322
</PropertyGroup>
2423
<ItemDefinitionGroup>
2524
<Link Condition="'$(ChakraICU)'=='shared'">
2625
<SubSystem>Console</SubSystem>
2726
<NoEntryPoint>true</NoEntryPoint>
2827
</Link>
2928
</ItemDefinitionGroup>
30-
<ItemGroup Condition="'$(BuildLocalICU)'=='true'">
31-
<None Include="$(IntDir)icudt$(IcuVersionMajor)l_dat.obj" /> <!-- forces the automagic build system to create a lib from the obj -->
29+
<ItemGroup Condition="'$(BuildChakraICUData)'=='true'">
30+
<!-- TODO(jahorto): allow the data file to be trimmed or allow an alternate data file to be supplied -->
3231
<CustomBuild Include="$(MSBuildThisFileDirectory)source\data\in\icudt$(IcuVersionMajor)l.dat">
33-
<Command>$(GenCCodePath) --object --destdir $(IntDir) --entrypoint icudt$(IcuVersionMajor) $(IcuSourceDirectory)\data\in\icudt$(IcuVersionMajor)l.dat</Command>
32+
<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>
3433
<Outputs>$(IntDir)icudt$(IcuVersionMajor)l_dat.obj</Outputs>
3534
</CustomBuild>
36-
<ProjectReference Include="$(MSBuildThisFileDirectory)Chakra.ICU.GenCCode.vcxproj">
37-
<Project>{FA9E9590-0E6C-40F9-9527-E608F2DFA76D}</Project>
38-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
39-
</ProjectReference>
4035
</ItemGroup>
4136
<Import Project="$(BuildConfigPropsPath)Chakra.Build.targets" Condition="exists('$(BuildConfigPropsPath)Chakra.Build.targets')" />
4237
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

deps/Chakra.ICU/Chakra.ICU.GenCCode.vcxproj

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,10 @@
3636
<ItemGroup Condition="'$(BuildLocalICU)'=='true'">
3737
<ClCompile Include="$(IcuGenccodeSources)" />
3838
<ClInclude Include="$(IcuGenccodeHeaders)" />
39-
<ProjectReference Include="$(MSBuildThisFileDirectory)Chakra.ICU.Common.vcxproj">
40-
<Project>{EE2A3111-4D85-427C-B0AB-E6B0EA7FFB44}</Project>
41-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
42-
</ProjectReference>
43-
<ProjectReference Include="$(MSBuildThisFileDirectory)Chakra.ICU.i18n.vcxproj">
44-
<Project>{0494C753-5BB9-45AA-874E-E61B9922E88F}</Project>
45-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
46-
</ProjectReference>
4739
<ProjectReference Include="$(MSBuildThisFileDirectory)Chakra.ICU.Toolutil.vcxproj">
4840
<Project>{A87105AD-8F4A-4D7A-9096-EFD30DBA3E01}</Project>
4941
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
5042
</ProjectReference>
51-
<ProjectReference Include="$(MSBuildThisFileDirectory)Chakra.ICU.Stubdata.vcxproj">
52-
<Project>{E14F373D-05A0-4259-A5E9-AFE8405FB847}</Project>
53-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
54-
</ProjectReference>
5543
</ItemGroup>
5644
<Import Project="$(BuildConfigPropsPath)Chakra.Build.targets" Condition="exists('$(BuildConfigPropsPath)Chakra.Build.targets')" />
5745
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

deps/Chakra.ICU/Chakra.ICU.Stubdata.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
<Link Condition="'$(ChakraICU)'=='shared'">
3636
<SubSystem>Console</SubSystem>
3737
<!-- Make Chakra.ICU.Stubdata pretend like its Chakra.ICU.Data for linking purposes -->
38-
<OutputFile>$(OutDir)\Chakra.ICU.Data.dll</OutputFile>
39-
<ImportLibrary>$(OutDir)\Chakra.ICU.Data.lib</ImportLibrary>
38+
<OutputFile>$(OutDir)\Chakra.ICU.Stubdata\Chakra.ICU.Data.dll</OutputFile>
39+
<ImportLibrary>$(OutDir)\Chakra.ICU.Stubdata\Chakra.ICU.Data.lib</ImportLibrary>
4040
</Link>
4141
</ItemDefinitionGroup>
4242
<ItemGroup Condition="'$(BuildLocalICU)'=='true'">

deps/Chakra.ICU/Chakra.ICU.Toolutil.vcxproj

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<!-- Chakra.ICU.Toolutil -->
4+
<!--
5+
This project contains all of the library code for ICU tools such as GenCCode.
6+
GenCCode produces a platform-agnostic object file, but must be built in the host architecture.
7+
As a result, GenCCode.vcxproj and this project are built separately from the rest
8+
-->
9+
210
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
311
<Import Condition="'$(ChakraBuildPathImported)'!='true'" Project="$(SolutionDir)Chakra.Build.Paths.props" />
412
<Import Project="$(BuildConfigPropsPath)Chakra.Build.ProjectConfiguration.props" />
@@ -23,19 +31,33 @@
2331
<ClCompile>
2432
<PreprocessorDefinitions>
2533
%(PreprocessorDefinitions);
26-
U_TOOLUTIL_IMPLEMENTATION=1
34+
U_COMBINED_IMPLEMENTATION=1;
35+
U_TOOLUTIL_IMPLEMENTATION=1;
36+
U_STUBDATA_IMPLEMENTATION=1;
37+
U_COMMON_IMPLEMENTATION=1;
38+
U_I18N_IMPLEMENTATION=1
2739
</PreprocessorDefinitions>
2840

2941
<AdditionalIncludeDirectories>
3042
%(AdditionalIncludeDirectories);
3143
$(IcuSourceDirectory)\common;
3244
$(IcuSourceDirectory)\i18n
3345
</AdditionalIncludeDirectories>
46+
47+
<!-- Some ICU files use embedded UTF-8 -->
48+
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
3449
</ClCompile>
3550
</ItemDefinitionGroup>
3651
<ItemGroup Condition="'$(BuildLocalICU)'=='true'">
3752
<ClCompile Include="$(IcuToolutilSources)" />
53+
<ClCompile Include="$(IcuCommonSources)" />
54+
<ClCompile Include="$(IcuI18nSources)" />
55+
<ClCompile Include="$(IcuStubdataSources)" />
56+
3857
<ClInclude Include="$(IcuToolutilHeaders)" />
58+
<ClInclude Include="$(IcuCommonHeaders)" />
59+
<ClInclude Include="$(IcuI18nHeaders)" />
60+
<ClInclude Include="$(IcuStubdataHeaders)" />
3961
</ItemGroup>
4062
<Import Project="$(BuildConfigPropsPath)Chakra.Build.targets" Condition="exists('$(BuildConfigPropsPath)Chakra.Build.targets')" />
4163
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

tools/icu/create_data_obj.ps1

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# -------------------------------------------------------------------------------------------------------
2+
# Copyright (C) Microsoft. All rights reserved.
3+
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
4+
# -------------------------------------------------------------------------------------------------------
5+
6+
# This file is called as a CustomBuild step from Chakra.ICU.Data.vcxproj.
7+
#
8+
# To generate the data file, we need to build GenCCode.exe for the host platform. We can then run
9+
# GenCCode.exe --object to produce a platform-agnostic object file, which the linking step of
10+
# Chakra.ICU.Data should be able to link into a DLL for the target platform.
11+
12+
param(
13+
[parameter(Mandatory=$true)]
14+
[alias("d")]
15+
[string]$DataFile,
16+
17+
[parameter(Mandatory=$true)]
18+
[alias("p")]
19+
[string]$TargetPlatform,
20+
21+
[parameter(Mandatory=$true)]
22+
[alias("c")]
23+
[string]$TargetConfiguration,
24+
25+
[parameter(Mandatory=$true)]
26+
[alias("m")]
27+
[string]$MSBuildPath,
28+
29+
[parameter(Mandatory=$true)]
30+
[alias("i")]
31+
[string]$IntDir,
32+
33+
[parameter(Mandatory=$true)]
34+
[alias("v")]
35+
[string]$IcuVersionMajor
36+
)
37+
38+
$scriptRoot=Split-Path -Path $MyInvocation.MyCommand.Path
39+
40+
# This gets the actual platform of the host, as opposed to the %PROCESSOR_ARCHITECTURE% environment variable which
41+
# changes depending on if 32 and 64 bit binaries are calling each other
42+
$hostPlatform=(Get-ItemProperty "HKLM:\System\CurrentControlSet\Control\Session Manager\Environment").PROCESSOR_ARCHITECTURE
43+
if ($hostPlatform -eq "AMD64") {
44+
$hostPlatform="x64"
45+
} elseif ($hostPlatform -eq "X86") {
46+
$hostPlatform="x86"
47+
}
48+
49+
Write-Host DataFile: $DataFile
50+
Write-Host TargetPlatform: $TargetPlatform
51+
Write-Host MSBuildPath: $MSBuildPath
52+
Write-Host HostPlatform: $hostPlatform
53+
54+
$sep="_"
55+
$genccode="$scriptRoot\..\..\Build\VcBuild\bin\$hostPlatform" + "_release\Chakra.ICU.GenCCode.exe"
56+
57+
if (-not (Test-Path $genccode)) {
58+
Write-Host
59+
Write-Host Could not find $genccode, building from scratch
60+
cmd /c "$MSBuildPath" /nologo "$scriptRoot\..\..\deps\Chakra.ICU\Chakra.ICU.GenCCode.vcxproj" "/p:Platform=$hostPlatform;Configuration=Release;SolutionDir=$scriptRoot\..\..\Build\"
61+
}
62+
63+
Write-Host
64+
Write-Host Building object file
65+
cmd /c "$genccode" --object --destdir $IntDir --entrypoint icudt$IcuVersionMajor $DataFile
66+
67+
Write-Host "Object file created in $IntDir"

0 commit comments

Comments
 (0)