Module: WASMPlatform

Defined in:
lib/mundler/platforms/wasm.rb

Class Method Summary collapse

Class Method Details

.config(options, build_config) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/mundler/platforms/wasm.rb', line 2

def self.config(options, build_config)
  cc_command = "emcc"
  linker_command = "emcc"
  archiver_command = "emar"

  cc_flags = ["-Os"]

  <<~BUILD
    MRuby::CrossBuild.new("wasm") do |conf|
      toolchain :clang

      #{build_config.gemboxes}
      #{build_config.gems(:wasm)}

      conf.cc do |cc|
        cc.command = #{cc_command.inspect}
        cc.flags = #{cc_flags.inspect}
      end

      conf.linker do |l|
        l.command = #{linker_command.inspect}
      end

      conf.archiver do |a|
        a.command = #{archiver_command.inspect}
      end
    end
  BUILD
end