Class: CKick::LibraryLink
- Inherits:
-
Object
- Object
- CKick::LibraryLink
- Defined in:
- lib/ckick/library_link.rb
Overview
Represents a library link (-l compiler option or library name to be passed to CMake target_link_libraries() function)
Instance Method Summary collapse
-
#cmake ⇒ Object
cmake code content (only library name, not command).
-
#initialize(args = {}) ⇒ LibraryLink
constructor
initializes object with an Hash hash keys: *
:name
- library name (lib#name.a/.so) as is. -
#raw_flag ⇒ Object
corresponding compiler link flag (-l option).
-
#to_hash_element ⇒ Object
converts to hashable element name as is.
-
#to_s ⇒ Object
converts to String name as is.
Constructor Details
#initialize(args = {}) ⇒ LibraryLink
initializes object with an Hash hash keys:
-
:name
- library name (lib#name.a/.so) as is
15 16 17 18 19 |
# File 'lib/ckick/library_link.rb', line 15 def initialize args={} name = args[:name] || "" raise CKick::IllegalInitializationError, "No name provided to library link" unless name.is_a?(String) && !name.empty? @name = name end |
Instance Method Details
#cmake ⇒ Object
cmake code content (only library name, not command)
39 40 41 |
# File 'lib/ckick/library_link.rb', line 39 def cmake @name end |
#raw_flag ⇒ Object
corresponding compiler link flag (-l option)
34 35 36 |
# File 'lib/ckick/library_link.rb', line 34 def raw_flag "-l#{@name}" end |
#to_hash_element ⇒ Object
converts to hashable element name as is
23 24 25 |
# File 'lib/ckick/library_link.rb', line 23 def to_hash_element @name end |
#to_s ⇒ Object
converts to String name as is
29 30 31 |
# File 'lib/ckick/library_link.rb', line 29 def to_s @name end |