Sha256: 9f3370e971304f7c481aafee98f4118bbee41ffa2e0efb6c38fbd72148e6ab1c

Contents?: true

Size: 792 Bytes

Versions: 23

Compression:

Stored size: 792 Bytes

Contents

module Cxxproject
  module HasLibraries
    LIB = :lib
    USERLIB = :userlib
    LIB_WITH_PATH = :lib_with_path
    SEARCH_PATH = :search_path
    DEPENDENCY = :dependency

    def lib_elements
      @lib_elements ||= []
    end

    # value: can be string or building block
    def add_lib_element(type, value, front = false)
      elem = [type, value.instance_of?(String) ? value : value.name]
      if front
        lib_elements.unshift(elem)
      else
        lib_elements << elem
      end
    end

    # 1. element: type
    # 2. element: name, must not be a building block
    def add_lib_elements(array_of_tuples, front = false)
      if front
        @lib_elements = array_of_tuples+lib_elements
      else
        lib_elements.concat(array_of_tuples)
      end
    end

  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
cxxproject-0.6.4 lib/cxxproject/buildingblocks/has_libraries_mixin.rb
cxxproject-0.6.2 lib/cxxproject/buildingblocks/has_libraries_mixin.rb
cxxproject-0.6.1 lib/cxxproject/buildingblocks/has_libraries_mixin.rb