Module: MilkTea::VendoredTracy

Defined in:
lib/milk_tea/bindings/vendored_tracy.rb

Class Method Summary collapse

Class Method Details

.all_tools(root: MilkTea.root) ⇒ Object



35
36
37
# File 'lib/milk_tea/bindings/vendored_tracy.rb', line 35

def self.all_tools(root: MilkTea.root)
  [profiler_tool(root:)]
end

.library(root: MilkTea.root) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/milk_tea/bindings/vendored_tracy.rb', line 7

def self.library(root: MilkTea.root)
  data = MilkTea.writable_root_for(root)
  source = data.join("third_party/tracy-upstream/public/TracyClient.cpp")
  build = data.join("tmp/tracy-lib")
  MilkTea::VendoredCLibrary::Archive.new(
    name: "tracy",
    source_root: source.dirname,
    build_root: build,
    archive_name: "libtracyclient.a",
    sources: ["TracyClient.cpp"],
    include_roots: [source.dirname],
    defines: ["TRACY_ENABLE"],
    default_ar: "ar",
  )
end

.profiler_tool(root: MilkTea.root) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/milk_tea/bindings/vendored_tracy.rb', line 23

def self.profiler_tool(root: MilkTea.root)
  data = MilkTea.writable_root_for(root)
  source_dir = data.join("third_party/tracy-upstream/profiler")
  MilkTea::VendoredTool.new(
    name: "tracy-profiler",
    source_dir: source_dir.to_s,
    build_dir: data.join("tmp/tracy-profiler-build").to_s,
    output_binary_name: "tracy-profiler",
    cmake_args: ["-DLEGACY=ON"],
  )
end