Class: MilkTea::VendoredCLibrary::Base
- Inherits:
-
Object
- Object
- MilkTea::VendoredCLibrary::Base
- Defined in:
- lib/milk_tea/bindings/vendored_c_library.rb
Direct Known Subclasses
Archive, CMake, MilkTea::VendoredRaylib::AdaptiveArchive, MilkTea::VendoredSteamworks::Library
Instance Attribute Summary collapse
-
#include_roots ⇒ Object
readonly
Returns the value of attribute include_roots.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source_root ⇒ Object
readonly
Returns the value of attribute source_root.
Instance Method Summary collapse
- #build_flags(platform: nil) ⇒ Object
- #include_flags ⇒ Object
-
#initialize(name:, source_root:, include_roots: [], cc_env_var: nil) ⇒ Base
constructor
A new instance of Base.
- #link_flags(platform: nil) ⇒ Object
- #prepare!(env: ENV, cc: ENV.fetch("CC", "cc"), platform: nil) ⇒ Object
Constructor Details
#initialize(name:, source_root:, include_roots: [], cc_env_var: nil) ⇒ Base
Returns a new instance of Base.
15 16 17 18 19 20 |
# File 'lib/milk_tea/bindings/vendored_c_library.rb', line 15 def initialize(name:, source_root:, include_roots: [], cc_env_var: nil) @name = name.to_s @source_root = Pathname.new(File.(source_root.to_s)) @include_roots = include_roots.map { |path| Pathname.new(File.(path.to_s)) }.freeze @cc_env_var = cc_env_var end |
Instance Attribute Details
#include_roots ⇒ Object (readonly)
Returns the value of attribute include_roots.
13 14 15 |
# File 'lib/milk_tea/bindings/vendored_c_library.rb', line 13 def include_roots @include_roots end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/milk_tea/bindings/vendored_c_library.rb', line 13 def name @name end |
#source_root ⇒ Object (readonly)
Returns the value of attribute source_root.
13 14 15 |
# File 'lib/milk_tea/bindings/vendored_c_library.rb', line 13 def source_root @source_root end |
Instance Method Details
#build_flags(platform: nil) ⇒ Object
26 27 28 |
# File 'lib/milk_tea/bindings/vendored_c_library.rb', line 26 def build_flags(platform: nil) include_flags end |
#include_flags ⇒ Object
22 23 24 |
# File 'lib/milk_tea/bindings/vendored_c_library.rb', line 22 def include_flags include_roots.map { |path| "-I#{path}" } end |
#link_flags(platform: nil) ⇒ Object
34 35 36 |
# File 'lib/milk_tea/bindings/vendored_c_library.rb', line 34 def link_flags(platform: nil) raise NotImplementedError, "#{self.class} must implement #link_flags" end |
#prepare!(env: ENV, cc: ENV.fetch("CC", "cc"), platform: nil) ⇒ Object
30 31 32 |
# File 'lib/milk_tea/bindings/vendored_c_library.rb', line 30 def prepare!(env: ENV, cc: ENV.fetch("CC", "cc"), platform: nil) raise NotImplementedError, "#{self.class} must implement #prepare!" end |