From a3e07be506f8207d8a77d0ce76a2c4fd510cb99d Mon Sep 17 00:00:00 2001 From: Jack Horton Date: Fri, 23 Feb 2018 14:21:20 -0800 Subject: [PATCH] Support shared builds of Chakra.ICU --- Build/Chakra.Build.props | 9 +++++++++ deps/Chakra.ICU/Chakra.ICU.Build.props | 2 +- deps/Chakra.ICU/Chakra.ICU.Common.vcxproj | 3 +++ deps/Chakra.ICU/Chakra.ICU.Data.vcxproj | 6 ++++++ deps/Chakra.ICU/Chakra.ICU.Stubdata.vcxproj | 9 ++++++++- deps/Chakra.ICU/Chakra.ICU.i18n.vcxproj | 7 ++++++- lib/Common/CommonDefines.h | 13 +++++++++++++ lib/Runtime/PlatformAgnostic/ICU.h | 2 -- 8 files changed, 46 insertions(+), 5 deletions(-) diff --git a/Build/Chakra.Build.props b/Build/Chakra.Build.props index 5bb7379078f..604c38c95c1 100644 --- a/Build/Chakra.Build.props +++ b/Build/Chakra.Build.props @@ -59,6 +59,15 @@ %(PreprocessorDefinitions); INTL_ICU=1 + + %(PreprocessorDefinitions); + U_STATIC_IMPLEMENTATION=1 + + + U_DISABLE_RENAMING=1; + ICU_VERSION=$(IcuVersionMajor); + %(PreprocessorDefinitions) + %(PreprocessorDefinitions); GLOBAL_ENABLE_WRITE_BARRIER=1 diff --git a/deps/Chakra.ICU/Chakra.ICU.Build.props b/deps/Chakra.ICU/Chakra.ICU.Build.props index 4dfc5df8945..ceb44143613 100644 --- a/deps/Chakra.ICU/Chakra.ICU.Build.props +++ b/deps/Chakra.ICU/Chakra.ICU.Build.props @@ -18,7 +18,7 @@ UCONFIG_NO_REGULAR_EXPRESSIONS=1; UCONFIG_NO_SERVICE=1; %(PreprocessorDefinitions) - + diff --git a/deps/Chakra.ICU/Chakra.ICU.Common.vcxproj b/deps/Chakra.ICU/Chakra.ICU.Common.vcxproj index d5fd1c99c39..e64920ff462 100644 --- a/deps/Chakra.ICU/Chakra.ICU.Common.vcxproj +++ b/deps/Chakra.ICU/Chakra.ICU.Common.vcxproj @@ -27,6 +27,9 @@ U_COMMON_IMPLEMENTATION=1 + + Console + diff --git a/deps/Chakra.ICU/Chakra.ICU.Data.vcxproj b/deps/Chakra.ICU/Chakra.ICU.Data.vcxproj index 25390c9b645..061f4b7a992 100644 --- a/deps/Chakra.ICU/Chakra.ICU.Data.vcxproj +++ b/deps/Chakra.ICU/Chakra.ICU.Data.vcxproj @@ -21,6 +21,12 @@ <_ProjectFileVersion>10.0.30319.1 $(OutBaseDir)\bin\$(PlatformPathName.ToLower())_$(Configuration.ToLower())\Chakra.ICU.GenCCode.exe + + + Console + true + + diff --git a/deps/Chakra.ICU/Chakra.ICU.Stubdata.vcxproj b/deps/Chakra.ICU/Chakra.ICU.Stubdata.vcxproj index f62b05efe05..ae2f9a9bcbd 100644 --- a/deps/Chakra.ICU/Chakra.ICU.Stubdata.vcxproj +++ b/deps/Chakra.ICU/Chakra.ICU.Stubdata.vcxproj @@ -9,7 +9,8 @@ Chakra.ICU.Stubdata - StaticLibrary + StaticLibrary + DynamicLibrary @@ -31,6 +32,12 @@ $(IcuSourceDirectory)\common + + Console + + $(OutDir)\Chakra.ICU.Data.dll + $(OutDir)\Chakra.ICU.Data.lib + diff --git a/deps/Chakra.ICU/Chakra.ICU.i18n.vcxproj b/deps/Chakra.ICU/Chakra.ICU.i18n.vcxproj index 898ebcfe2e6..e66ce0ad0c7 100644 --- a/deps/Chakra.ICU/Chakra.ICU.i18n.vcxproj +++ b/deps/Chakra.ICU/Chakra.ICU.i18n.vcxproj @@ -35,13 +35,18 @@ /utf-8 %(AdditionalOptions) + + Console + {E14F373D-05A0-4259-A5E9-AFE8405FB847} - false + + + {EE2A3111-4D85-427C-B0AB-E6B0EA7FFB44} diff --git a/lib/Common/CommonDefines.h b/lib/Common/CommonDefines.h index 99bd99feec3..6c50e2c8d93 100644 --- a/lib/Common/CommonDefines.h +++ b/lib/Common/CommonDefines.h @@ -110,6 +110,19 @@ #define ENABLE_UNICODE_API 1 // Enable use of Unicode-related APIs #endif +// ICU Configuration +#if defined(HAS_ICU) || defined(HAS_REAL_ICU) +#define U_SHOW_CPLUSPLUS_API 0 +// ICU 55 (Ubuntu 16.04 system default) has uloc_toUnicodeLocale* marked as draft, which is required for Intl +#if ICU_VERSION > 56 +#define U_DEFAULT_SHOW_DRAFT 0 +#define U_HIDE_DRAFT_API 1 +#endif +#define U_HIDE_DEPRECATED_API 1 +#define U_HIDE_OBSOLETE_API 1 +#define U_HIDE_INTERNAL_API 1 +#endif + // Language features #if !defined(CHAKRACORE_LITE) && (defined(_WIN32) || defined(INTL_ICU)) diff --git a/lib/Runtime/PlatformAgnostic/ICU.h b/lib/Runtime/PlatformAgnostic/ICU.h index a2f6647fb10..abaaea08bd0 100644 --- a/lib/Runtime/PlatformAgnostic/ICU.h +++ b/lib/Runtime/PlatformAgnostic/ICU.h @@ -8,8 +8,6 @@ #ifdef WINDOWS10_ICU #include #else -#define U_STATIC_IMPLEMENTATION 1 -#define U_SHOW_CPLUSPLUS_API 0 #include "unicode/ucal.h" #include "unicode/ucol.h" #include "unicode/udat.h"