Class: RubyWasm::Target

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_wasm/build/target.rb

Overview

A build target representation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(triple, pic: false) ⇒ Target

Returns a new instance of Target.



6
7
8
9
# File 'lib/ruby_wasm/build/target.rb', line 6

def initialize(triple, pic: false)
  @triple = triple
  @pic = pic
end

Instance Attribute Details

#tripleObject (readonly)

Returns the value of attribute triple.



4
5
6
# File 'lib/ruby_wasm/build/target.rb', line 4

def triple
  @triple
end

Instance Method Details

#cache_key(digest) ⇒ Object



19
20
21
22
# File 'lib/ruby_wasm/build/target.rb', line 19

def cache_key(digest)
  digest << @triple
  digest << "pic" if @pic
end

#pic?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/ruby_wasm/build/target.rb', line 11

def pic?
  @pic
end

#to_sObject



15
16
17
# File 'lib/ruby_wasm/build/target.rb', line 15

def to_s
  "#{@triple}#{@pic ? "-pic" : ""}"
end