Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 0f4419e

Browse files
committed
Update paths for the new monolith static library
1 parent 45996a9 commit 0f4419e

2 files changed

Lines changed: 6 additions & 19 deletions

File tree

ext/libv8/paths.rb

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,17 @@ def include_paths
1111
end
1212

1313
def object_paths
14-
[:base, :libplatform, :libsampler, :libbase, :snapshot].map do |name|
15-
Shellwords.escape libv8_object(name)
16-
end
14+
[Shellwords.escape(File.join(vendored_source_path,
15+
'out.gn',
16+
'libv8',
17+
'obj',
18+
"libv8_monolith.#{config['LIBEXT']}"))]
1719
end
1820

1921
def config
2022
RbConfig::MAKEFILE_CONFIG
2123
end
2224

23-
def libv8_object(name)
24-
filename = "#{libv8_profile}/libv8_#{name}.#{config['LIBEXT']}"
25-
unless File.exist? filename
26-
filename = "#{libv8_profile}/obj.target/tools/gyp/libv8_#{name}.#{config['LIBEXT']}"
27-
end
28-
return filename
29-
end
30-
31-
def libv8_profile
32-
base = "#{vendored_source_path}/out/#{Libv8::Arch.libv8_arch}"
33-
debug = "#{base}.debug"
34-
File.exist?(debug) ? debug : "#{base}.release"
35-
end
36-
3725
def vendored_source_path
3826
File.expand_path "../../../vendor/v8", __FILE__
3927
end

spec/location_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
allow(@context).to receive(:ldflags) {@ldflags ||= "-lobjc -lpthread"}
5656

5757
allow(Libv8::Paths).to receive(:vendored_source_path) {"/foo bar/v8"}
58-
allow(Libv8::Arch).to receive(:libv8_arch) {'x64'}
5958
@location.configure @context
6059
end
6160

@@ -64,7 +63,7 @@
6463
end
6564

6665
it "prepends the locations of any libv8 objects on the the ldflags" do
67-
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_libsampler.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"
66+
expect(@context.ldflags).to eql "/foo\\ bar/v8/out.gn/libv8/obj/libv8_monolith.a -lobjc -lpthread"
6867
end
6968
end
7069
end

0 commit comments

Comments
 (0)