lib/cxxproject/buildingblocks/binary_library.rb in cxxproject-0.4.6 vs lib/cxxproject/buildingblocks/binary_library.rb in cxxproject-0.5.47
- old
+ new
@@ -1,16 +1,39 @@
require 'cxxproject/buildingblocks/building_block'
require 'cxxproject/buildingblocks/has_libraries_mixin'
+require 'cxxproject/buildingblocks/has_includes_mixin'
-class BinaryLibrary < BuildingBlock
- include HasLibraries
+module Cxxproject
- def initialize(name)
- super(name)
- libs_to_search << name
- end
+ class BinaryLibrary < BuildingBlock
+ include HasLibraries
+ include HasIncludes
- def get_task_name()
- libs_to_search[0]
- end
+ def initialize(name, useNameAsLib = true)
+ super(name)
+ if useNameAsLib
+ @useNameAsLib = name
+ add_lib_element(HasLibraries::LIB, name, true)
+ else
+ @useNameAsLib = nil
+ end
+ end
+ def get_task_name()
+ return @useNameAsLib if @useNameAsLib
+ @name
+ end
+
+
+ def convert_to_rake()
+ res = task get_task_name
+ def res.needed?
+ return false
+ end
+ res.transparent_timestamp = true
+ res.type = Rake::Task::BINARY
+ setup_rake_dependencies(res)
+ res
+ end
+
+ end
end