Sha256: 0d2617238cabf63eb950d15de87f5966b1e581971b7e669e8ebc9cb291b2b7d5

Contents?: true

Size: 977 Bytes

Versions: 3

Compression:

Stored size: 977 Bytes

Contents

# frozen_string_literal: true

MRuby::Build.new do |conf|
  if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
    toolchain :visualcpp
  else
    toolchain :gcc
  end

  conf.gembox 'default'
end

MRuby::CrossBuild.new('wasm') do |conf|
  toolchain :clang

  # C compiler settings
  conf.cc do |cc|
    cc.command = 'emcc'
    cc.compile_options = '%<flags>s -s WASM=1 -o %<outfile>s ' \
                         '-c %<infile>s -Oz --llvm-opts 3'
  end

  # Linker settings
  conf.linker do |linker|
    linker.command = 'emcc'
    linker.link_options = '%<flags>s -o %<outfile>s %<objs>s %<libs>s'
  end

  # Archiver settings
  conf.archiver do |archiver|
    archiver.command = 'emcc'
    archiver.archive_options = '%<objs>s -s WASM=1 -o %<outfile>s'
  end

  # file extensions
  conf.exts do |exts|
    exts.object = '.bc'
    exts.executable = '' # '.exe' if Windows
    exts.library = '.bc'
  end

  # TODO: Allow specify customize gembox
  conf.gembox 'default'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mwc-0.4.0 lib/mwc/templates/app/config/build.rb
mwc-0.3.0 lib/mwc/templates/app/config/build.rb
mwc-0.2.0 lib/mwc/templates/config/build.rb