Class: MilkTea::VendoredRaylib::AdaptiveArchive

Inherits:
MilkTea::VendoredCLibrary::Base show all
Defined in:
lib/milk_tea/bindings/vendored_raylib.rb

Instance Attribute Summary

Attributes inherited from MilkTea::VendoredCLibrary::Base

#include_roots, #name, #source_root

Instance Method Summary collapse

Methods inherited from MilkTea::VendoredCLibrary::Base

#include_flags

Constructor Details

#initialize(root:) ⇒ AdaptiveArchive

Returns a new instance of AdaptiveArchive.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/milk_tea/bindings/vendored_raylib.rb', line 49

def initialize(root:)
  sr = VendoredRaylib.source_root(root:)
  super(
    name: "raylib",
    source_root: sr,
    include_roots: [sr],
    cc_env_var: "RAYLIB_CC",
  )
  @desktop_archive = VendoredCLibrary::Archive.new(
    name: "raylib",
    source_root: sr,
    build_root: VendoredRaylib.build_root(root:),
    archive_name: "libraylib.a",
    sources: SOURCES,
    include_roots: [sr],
    defines: DESKTOP_DEFINES,
    system_link_flags: DESKTOP_SYSTEM_LINK_FLAGS,
    cc_env_var: "RAYLIB_CC",
  )
  @wasm_archive = VendoredCLibrary::Archive.new(
    name: "raylib",
    source_root: sr,
    build_root: VendoredRaylib.build_root(root:, platform: :wasm),
    archive_name: "libraylib.a",
    sources: SOURCES,
    include_roots: [sr],
    defines: WASM_DEFINES,
    c_flags: WASM_COMPILE_FLAGS,
    system_link_flags: WASM_SYSTEM_LINK_FLAGS,
    cc_env_var: "RAYLIB_CC",
    default_ar: "emar",
  )
end

Instance Method Details

#build_flags(platform: nil) ⇒ Object



87
88
89
# File 'lib/milk_tea/bindings/vendored_raylib.rb', line 87

def build_flags(platform: nil)
  archive_for(platform).build_flags
end


83
84
85
# File 'lib/milk_tea/bindings/vendored_raylib.rb', line 83

def link_flags(platform: nil)
  archive_for(platform).link_flags
end

#prepare!(env: ENV, cc: ENV.fetch("CC", "cc"), platform: nil) ⇒ Object



91
92
93
# File 'lib/milk_tea/bindings/vendored_raylib.rb', line 91

def prepare!(env: ENV, cc: ENV.fetch("CC", "cc"), platform: nil)
  archive_for(platform).prepare!(env:, cc:, platform:)
end