This repository was archived by the owner on Dec 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11require 'rbconfig'
2+ require 'shellwords'
23require File . expand_path '../arch' , __FILE__
34
45module Libv8
56 module Paths
67 module_function
78
89 def include_paths
9- [ "#{ vendored_source_path } /include" ]
10+ [ Shellwords . escape ( "#{ vendored_source_path } /include" ) ]
1011 end
1112
1213 def object_paths
13- [ libv8_object ( :base ) , libv8_object ( :snapshot ) ]
14+ [ libv8_object ( :base ) , libv8_object ( :snapshot ) ] . map do |path |
15+ Shellwords . escape path
16+ end
1417 end
1518
1619 def config
Original file line number Diff line number Diff line change 5454 @context . stub ( :incflags ) { @incflags ||= "-I/usr/include -I/usr/local/include" }
5555 @context . stub ( :ldflags ) { @ldflags ||= "-lobjc -lpthread" }
5656
57- Libv8 ::Paths . stub ( :include_paths ) { [ "/frp /v8/include" ] }
58- Libv8 ::Paths . stub ( :object_paths ) { [ "/frp/v8/obj/libv8_base.a" , "/frp/v8/obj/libv8_snapshot.a" ] }
57+ Libv8 ::Paths . stub ( :vendored_source_path ) { "/foo bar /v8" }
58+ Libv8 ::Arch . stub ( :libv8_arch ) { 'x64' }
5959 @location . configure @context
6060 end
6161
6262 it "prepends its own incflags before any pre-existing ones" do
63- @context . incflags . should eql "-I/frp /v8/include -I/usr/include -I/usr/local/include"
63+ @context . incflags . should eql "-I/foo \\ bar /v8/include -I/usr/include -I/usr/local/include"
6464 end
6565
6666 it "prepends the locations of any libv8 objects on the the ldflags" do
67- @context . ldflags . should eql "/frp /v8/obj/ libv8_base.a /frp /v8/obj/libv8_snapshot.a -lobjc -lpthread"
67+ @context . ldflags . should 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_snapshot.a -lobjc -lpthread"
6868 end
6969 end
7070end
You can’t perform that action at this time.
0 commit comments