Class: Kompo::Packing::ForLinux

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

Overview

Linux implementation - compiles with gcc and pkg-config paths

Constant Summary collapse

%w[pthread dl m c].freeze

Instance Method Summary collapse

Instance Method Details

#runObject



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/kompo/tasks/packing.rb', line 169

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 (Linux)") 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