From 54290a59358f43b868ac1b7e51c27c91b270db00 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Thu, 16 Jun 2016 02:06:18 +0300 Subject: [PATCH] Create and package external snapshot --- Rakefile | 1 + ext/libv8/builder.rb | 3 --- ext/libv8/paths.rb | 2 +- spec/location_spec.rb | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Rakefile b/Rakefile index 4c64640..c3d9c99 100644 --- a/Rakefile +++ b/Rakefile @@ -36,6 +36,7 @@ task :binary => :compile do # V8 gemspec.files += Dir['vendor/v8/include/**/*.h'] gemspec.files += Dir['vendor/v8/out/**/*.a'] + gemspec.files += Dir['vendor/v8/out/**/*.bin'] FileUtils.chmod 0644, gemspec.files FileUtils.mkdir_p 'pkg' diff --git a/ext/libv8/builder.rb b/ext/libv8/builder.rb index 42bbcb3..9ee7948 100644 --- a/ext/libv8/builder.rb +++ b/ext/libv8/builder.rb @@ -26,9 +26,6 @@ module Libv8 end def gyp_defines(*defines) - # Do not use an external snapshot as we don't really care for binary size - defines << 'v8_use_external_startup_data=0' - # Do not use the GPLv3 ld.gold binary on Linux defines << 'linux_use_bundled_gold=0' diff --git a/ext/libv8/paths.rb b/ext/libv8/paths.rb index 85b04d0..296cd19 100644 --- a/ext/libv8/paths.rb +++ b/ext/libv8/paths.rb @@ -11,7 +11,7 @@ module Libv8 end def object_paths - [:base, :libplatform, :libbase, :snapshot].map do |name| + [:base, :libplatform, :libbase, :external_snapshot].map do |name| Shellwords.escape libv8_object(name) end end diff --git a/spec/location_spec.rb b/spec/location_spec.rb index fb3a3fa..cace047 100644 --- a/spec/location_spec.rb +++ b/spec/location_spec.rb @@ -64,7 +64,7 @@ describe "libv8 locations" do end it "prepends the locations of any libv8 objects on the the ldflags" do - expect(@context.ldflags).to eql "/foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_libplatform.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_libbase.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_snapshot.a -lobjc -lpthread" + expect(@context.ldflags).to eql "/foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_libplatform.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_libbase.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_external_snapshot.a -lobjc -lpthread" end end end