Class: PaperHouse::SharedLibraryTask
- Inherits:
-
LibraryTask
- Object
- Rake::TaskLib
- BuildTask
- LibraryTask
- PaperHouse::SharedLibraryTask
- Includes:
- LinkerOptions, Platform
- Defined in:
- lib/paper_house/shared_library_task.rb
Overview
Compiles *.c files into a shared library.
Constant Summary
Constants included from Platform
Platform::LDSHARED, Platform::MAC, Platform::RUBY_INCLUDES, Platform::RUBY_LIBDIR, Platform::SHARED_EXT, Platform::SONAME_OPTION
Instance Attribute Summary collapse
-
#version ⇒ Object
Library version string.
Attributes included from LinkerOptions
Attributes inherited from BuildTask
Attributes included from CcOptions
Instance Method Summary collapse
-
#initialize(name, version = nil) {|task| ... } ⇒ SharedLibraryTask
constructor
Defines a rake task called
namethat builds a shared library. -
#linker_name ⇒ Object
Name of library used by linkers.
-
#soname ⇒ Object
Soname of target library.
-
#target_file_name ⇒ Object
(also: #real_name)
Real name of target library.
Methods included from Platform
Methods included from LinkerOptions
#library_dependencies, #library_dependencies=
Methods inherited from LibraryTask
find_by_name, #library_name, #library_name=, #lname
Methods inherited from BuildTask
Constructor Details
#initialize(name, version = nil) {|task| ... } ⇒ SharedLibraryTask
Defines a rake task called name that builds a shared library. Note that version number must be set as the version argument or in the block to build the library.
27 28 29 30 |
# File 'lib/paper_house/shared_library_task.rb', line 27 def initialize(name, version = nil, &block) @version = version super name, &block end |
Instance Attribute Details
#version ⇒ Object
Library version string.
14 15 16 |
# File 'lib/paper_house/shared_library_task.rb', line 14 def version @version end |
Instance Method Details
#linker_name ⇒ Object
Name of library used by linkers.
40 41 42 |
# File 'lib/paper_house/shared_library_task.rb', line 40 def linker_name library_name + '.so' end |
#soname ⇒ Object
Soname of target library.
45 46 47 |
# File 'lib/paper_house/shared_library_task.rb', line 45 def soname File.basename(target_file_name).sub(/\.\d+\.\d+\Z/, '') end |
#target_file_name ⇒ Object Also known as: real_name
Real name of target library.
33 34 35 36 |
# File 'lib/paper_house/shared_library_task.rb', line 33 def target_file_name fail 'version option is a mandatory.' unless @version [linker_name, @version].join '.' end |