class Cxxproject::SharedLibrary

Attributes

compatibility[RW]
major[RW]
minor[RW]

Public Instance Methods

add_grouping_tasks(shared_lib) click to toggle source
# File lib/cxxproject/buildingblocks/linkable.rb, line 339
def add_grouping_tasks(shared_lib)
  namespace 'shared' do
    desc shared_lib
    task @name => shared_lib
  end
end
additional_object_file_flags() click to toggle source
# File lib/cxxproject/buildingblocks/linkable.rb, line 334
def additional_object_file_flags
  linker = @tcs[:LINKER]
  linker[:ADDITIONAL_OBJECT_FILE_FLAGS][target_os()]
end
additional_path_components() click to toggle source
# File lib/cxxproject/buildingblocks/linkable.rb, line 326
def additional_path_components()
  ['libs']
end
complete_init() click to toggle source
Calls superclass method Cxxproject::BuildingBlock#complete_init
# File lib/cxxproject/buildingblocks/linkable.rb, line 303
def complete_init()
  if @output_dir_abs
    add_lib_element(HasLibraries::LIB, @name, true)
    add_lib_element(HasLibraries::SEARCH_PATH, File.join(@output_dir, 'libs'), true)
  else
    add_lib_element(HasLibraries::LIB_WITH_PATH, File.join(@output_dir,"lib#{@name}.a"), true)
  end
  super
end
get_flags_for_output(linker) click to toggle source
# File lib/cxxproject/buildingblocks/linkable.rb, line 313
def get_flags_for_output(linker)
  [linker[:SHARED_FLAG]] + additional_linker_commands(linker) + [linker[:OUTPUT_FLAG]]
end
get_output_prefix(linker) click to toggle source
# File lib/cxxproject/buildingblocks/linkable.rb, line 317
def get_output_prefix(linker)
  linker[:OUTPUT_PREFIX][:SHARED_LIBRARY][target_os()]
end
get_output_suffix(linker) click to toggle source
# File lib/cxxproject/buildingblocks/linkable.rb, line 321
def get_output_suffix(linker)
  h = linker[:ADDITIONAL_COMMANDS][target_os()]
  "#{(h ? h.get_version_suffix(linker, self) : "")}#{shared_suffix linker}"
end
get_rake_task_type() click to toggle source
# File lib/cxxproject/buildingblocks/linkable.rb, line 330
def get_rake_task_type
  Rake::Task::SHARED_LIBRARY
end
shared_suffix(linker) click to toggle source
# File lib/cxxproject/buildingblocks/linkable.rb, line 346
def shared_suffix(linker)
  linker[:OUTPUT_SUFFIX][:SHARED_LIBRARY][target_os()]
end

Private Instance Methods

additional_linker_commands(linker) click to toggle source
# File lib/cxxproject/buildingblocks/linkable.rb, line 386
def additional_linker_commands(linker)
  h = linker[:ADDITIONAL_COMMANDS][target_os()]
  if h
    h.calc(linker, self)
  else
    []
  end
end
major_minor_suffix() click to toggle source
# File lib/cxxproject/buildingblocks/linkable.rb, line 375
def major_minor_suffix()
  "#{major_suffix}#{(major and minor ? '.' : '')}#{(minor ? minor : '')}"
end
major_suffix() click to toggle source
# File lib/cxxproject/buildingblocks/linkable.rb, line 371
def major_suffix()
  "#{major ? "." + major : ''}"
end
post_link_hook(linker) click to toggle source

Some symbolic links ln -s libfoo.so libfoo.1.2.so ln -s libfoo.1.so libfoo.1.2.so

# File lib/cxxproject/buildingblocks/linkable.rb, line 355
def post_link_hook(linker)
  basic_name = get_basic_name(linker)
  soname = get_soname(linker)
  symlink_lib_to basic_name
  symlink_lib_to soname
end