File: emscripten.rake

package info (click to toggle)
mruby 3.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,584 kB
  • sloc: ansic: 51,933; ruby: 29,510; yacc: 7,077; cpp: 517; makefile: 51; sh: 42
file content (36 lines) | stat: -rw-r--r-- 880 bytes parent folder | download
1
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
31
32
33
34
35
36
MRuby::Toolchain.new(:emscripten) do |conf|
  toolchain :clang

  # See:
  # - https://emscripten.org/docs/tools_reference/emcc.html
  # - https://emscripten.org/docs/tools_reference/settings_reference.html
  # - https://github.com/emscripten-core/emscripten/blob/main/src/settings.js
  compile_and_link_flags = [
  ]
  compile_flags = [
    *compile_and_link_flags,
    '-Wno-unused-but-set-variable',
  ]
  link_flags = [
    *compile_and_link_flags,
  ]

  conf.cc do |cc|
    cc.command = 'emcc'
    cc.flags.concat(compile_flags) unless ENV['CFLAGS']
  end

  conf.cxx do |cxx|
    cxx.command = 'em++'
    cxx.flags.concat(compile_flags) unless ENV['CXXFLAGS'] || ENV['CFLAGS']
  end

  conf.linker do |linker|
    linker.command = 'emcc'
    linker.flags.concat(link_flags) unless ENV['LDFLAGS']
  end

  conf.archiver do |archiver|
    archiver.command = 'emar'
  end
end