<commit_before># This file configures mruby to cross compile the emscripten version
# We expose this file here to let users adding mrbgems using the same
# method as in mruby

BASE_DIR = File.expand_path(File.dirname(__FILE__))
EMSCRIPTEN_DIR = File.join(BASE_DIR, %w[modules emscripten])

# Original mruby build, we only use the generated mrbc file for this native build
MRuby::Build.new do |conf|
  toolchain :gcc
end

# Emscripten customized toolchain
MRuby::Toolchain.new(:emscripten) do |conf|
  toolchain :clang

  conf.cc do |cc|
    cc.command = File.join(EMSCRIPTEN_DIR, 'emcc')
    cc.flags = (ENV['CFLAGS'] || %w(-DMRB_USE_FLOAT -Wall -Werror-implicit-function-declaration))
  end

  conf.linker do |linker|
    linker.command = File.join(EMSCRIPTEN_DIR, 'emcc')
  end

  conf.archiver.command = File.join(EMSCRIPTEN_DIR, 'emar')
end

# Cross build for emscripten, adding your mrbgems here.
MRuby::CrossBuild.new('emscripten') do |conf|
  toolchain :emscripten
<commit_msg>Remove block for linker since only cmd needs to be configured.<commit_after># This file configures mruby to cross compile the emscripten version
# We expose this file here to let users adding mrbgems using the same
# method as in mruby

BASE_DIR = File.expand_path(File.dirname(__FILE__))
EMSCRIPTEN_DIR = File.join(BASE_DIR, %w[modules emscripten])

# Original mruby build, we only use the generated mrbc file for this native build
MRuby::Build.new do |conf|
  toolchain :gcc
end

# Emscripten customized toolchain
MRuby::Toolchain.new(:emscripten) do |conf|
  toolchain :clang

  conf.cc do |cc|
    cc.command = File.join(EMSCRIPTEN_DIR, 'emcc')
    cc.flags = (ENV['CFLAGS'] || %w(-DMRB_USE_FLOAT -Wall -Werror-implicit-function-declaration))
  end

  conf.linker.command = File.join(EMSCRIPTEN_DIR, 'emcc')
  conf.archiver.command = File.join(EMSCRIPTEN_DIR, 'emar')
end

# Cross build for emscripten, adding your mrbgems here.
MRuby::CrossBuild.new('emscripten') do |conf|
  toolchain :emscripten

{'fraction_non_alphanumeric': 0.10216406643180674, 'fraction_numerical': 0.0, 'mean_word_length': 4.899109792284866, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5725938', 'n_tokens_mistral': 707, 'n_tokens_neox': 682, 'n_words': 202}