Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
fix icu
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Dec 19, 2016
1 parent 052a758 commit d4f451c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 15 deletions.
5 changes: 5 additions & 0 deletions atom/browser/javascript_environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <string>

#include "base/command_line.h"
#include "base/i18n/icu_util.h"
#include "base/message_loop/message_loop.h"
#include "content/public/common/content_switches.h"
#include "gin/array_buffer.h"
Expand Down Expand Up @@ -40,6 +41,10 @@ bool JavascriptEnvironment::Initialize() {
if (!js_flags.empty())
v8::V8::SetFlagsFromString(js_flags.c_str(), js_flags.size());

base::i18n::InitializeICU();

gin::V8Initializer::LoadV8Snapshot();
gin::V8Initializer::LoadV8Natives();
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance());
Expand Down
2 changes: 1 addition & 1 deletion build/node/node.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
'uv_use_dtrace': 'false',
'V8_BASE': '',
'v8_postmortem_support': 'false',
'v8_enable_i18n_support': 0,
'v8_inspector': 'false',
'library': 'static_library',
'msvs_use_common_release': 0,
'icu_small': 'false',
},
'target_defaults': {
'default_configuration': 'Release',
Expand Down
17 changes: 4 additions & 13 deletions build/node/v8.gypi
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
'variables': {
'icu_path': '../../../third_party/icu',
'icu_use_data_file_flag': 1,
# Using libc++ requires building for >= 10.7.
'mac_deployment_target': '10.8',
# Use the standard way of linking with msvc runtime.
'win_use_allocator_shim': 0,
'v8_enable_i18n_support': 1,
# The V8 libraries.
'v8_libraries': '["v8", "v8_snapshot", "v8_nosnapshot", "v8_external_snapshot", "v8_base", "v8_libbase", "v8_libplatform"]',
# The icu libraries.
'icu_libraries': '["icui18n", "icuuc"]',
'v8_use_snapshot': 'true',
'v8_use_external_startup_data': 1,
},
Expand Down Expand Up @@ -37,23 +37,14 @@
# Use C++11 library.
'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
},
# Force exporting icu's symbols.
'defines': [
'U_COMBINED_IMPLEMENTATION',
# Defining "U_COMBINED_IMPLEMENTATION" will add "explicit" for some
# constructors, make sure it doesn' happen.
'UNISTR_FROM_CHAR_EXPLICIT=',
'UNISTR_FROM_STRING_EXPLICIT=',
'U_NO_DEFAULT_INCLUDE_UTF_HEADERS=0',
],
'defines!': [
'U_STATIC_IMPLEMENTATION',
],
'target_conditions': [
['_type=="static_library" and _toolset=="target" and OS=="linux"', {
'standalone_static_library': 1,
}],
['_target_name in <(v8_libraries) + <(icu_libraries)', {
['_target_name in <(v8_libraries)', {
'xcode_settings': {
'DEAD_CODE_STRIPPING': 'NO', # -Wl,-dead_strip
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'NO',
Expand All @@ -80,4 +71,4 @@
}],
],
},
}
}
26 changes: 25 additions & 1 deletion patches/v8/filter.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/BUILD.gn b/BUILD.gn
index dcefe3706b84c1f726256a6053e60134953a014d..8cb4535042c80783aa592827869a4d7c2c6e026d 100644
index dcefe3706b84c1f726256a6053e60134953a014d..794abe164d911861a1a91180f1ec33cf405790bd 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -45,7 +45,7 @@ declare_args() {
Expand Down Expand Up @@ -55,6 +55,30 @@ index dcefe3706b84c1f726256a6053e60134953a014d..8cb4535042c80783aa592827869a4d7c
include_dirs = [ "include" ]
libs = []
if (is_android && current_toolchain != host_toolchain) {
@@ -149,9 +166,9 @@ config("external_config") {
# This config should only be applied to code that needs to be explicitly
# aware of whether we are using startup data or not.
config("external_startup_data") {
- if (v8_use_external_startup_data) {
+# if (v8_use_external_startup_data) {
defines = [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
- }
+# }
}

config("features") {
@@ -186,9 +203,9 @@ config("features") {
if (v8_enable_handle_zapping) {
defines += [ "ENABLE_HANDLE_ZAPPING" ]
}
- if (v8_use_external_startup_data) {
+# if (v8_use_external_startup_data) {
defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
- }
+# }
}

config("toolchain") {
@@ -726,6 +743,9 @@ source_set("v8_maybe_snapshot") {
}

Expand Down

1 comment on commit d4f451c

@bsclifton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

Please sign in to comment.