Class: Kompo::Packing::ForMacOS

Inherits:
Taski::Task
  • Object
show all
Includes:
CommonHelpers
Defined in:
lib/kompo/tasks/packing.rb

Overview

macOS implementation - compiles with clang and Homebrew paths

Constant Summary collapse

SYSTEM_LIBS =

macOS system libraries

%w[pthread m c].freeze
FRAMEWORKS =

macOS frameworks

%w[Foundation CoreFoundation Security].freeze

Instance Method Summary collapse

Instance Method Details

#runObject



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/kompo/tasks/packing.rb', line 83

def run
  work_dir = CollectDependencies.work_dir
  deps = CollectDependencies.deps
  ext_paths = CollectDependencies.ext_paths
  enc_files = CollectDependencies.enc_files
  @output_path = CollectDependencies.output_path

  command = build_command(work_dir, deps, ext_paths, enc_files)

  if Taski.args[:dry_run]
    Taski.message(Shellwords.join(command))
    return
  end

  group("Compiling binary (macOS)") do
    system(*command) or raise "Failed to compile final binary"
    puts "Binary size: #{File.size(@output_path) / 1024 / 1024} MB"
  end

  puts "Successfully created: #{@output_path}"
end