Class: CKick::Library
Instance Method Summary collapse
- #cmake ⇒ Object
-
#initialize(args = {}) ⇒ Library
constructor
A new instance of Library.
- #to_hash ⇒ Object
Methods inherited from Target
#create_structure, #paths, #to_s
Methods included from Hashable
Constructor Details
#initialize(args = {}) ⇒ Library
Returns a new instance of Library.
10 11 12 13 14 |
# File 'lib/ckick/library.rb', line 10 def initialize args={} super args @shared = args[:shared] || false end |
Instance Method Details
#cmake ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/ckick/library.rb', line 24 def cmake res = [] res << "add_library(#{@name}#{@shared ? " SHARED " : " "}#{@source.join(' ')})" unless @libs.empty? res << "target_link_libraries(#{@name} #{@libs.join(' ')})" end res.join("\n") end |
#to_hash ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/ckick/library.rb', line 16 def to_hash if @shared return super else return super.without(:shared) end end |