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

Commit 4c824c5

Browse files
committed
Select correct arch and debug mode
1 parent 8209659 commit 4c824c5

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

ext/libv8/builder.rb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
1+
unless $:.include? File.expand_path("../../../lib", __FILE__)
2+
$:.unshift File.expand_path("../../../lib", __FILE__)
3+
end
14
require 'mkmf'
25
require 'rbconfig'
36
require 'shellwords'
47
require 'libv8/version'
8+
require File.expand_path '../arch', __FILE__
59

610
module Libv8
711
class Builder
12+
include Libv8::Arch
13+
814
def gn_args
9-
'is_debug=false is_component_build=false v8_monolithic=true v8_use_external_startup_data=false target_cpu="x64" v8_target_cpu="x64" treat_warnings_as_errors=false v8_enable_i18n_support=false'
15+
%W(is_debug=#{debug_build? ? 'true' : 'false'}
16+
is_component_build=false
17+
v8_monolithic=true
18+
v8_use_external_startup_data=false
19+
target_cpu="#{libv8_arch}"
20+
v8_target_cpu="#{libv8_arch}"
21+
treat_warnings_as_errors=false
22+
v8_enable_i18n_support=false).join(' ')
1023
end
1124

1225
def generate_gn_args
1326
system "gn gen out.gn/libv8 --args='#{gn_args}'"
1427
end
1528

16-
def make_target
17-
profile = enable_config('debug') ? 'debug' : 'release'
18-
"#{libv8_arch}.#{profile}"
29+
def debug_build?
30+
enable_config('debug')
1931
end
2032

2133
def build_libv8!

0 commit comments

Comments
 (0)