Skip to content

Instantly share code, notes, and snippets.

@take-cheeze
Created July 5, 2018 02:33
Show Gist options
  • Save take-cheeze/dd8a932e98f0193e67e3f0eac0049ba5 to your computer and use it in GitHub Desktop.
Save take-cheeze/dd8a932e98f0193e67e3f0eac0049ba5 to your computer and use it in GitHub Desktop.
MRuby::Build.new do |conf|
# load specific toolchain settings
# Gets set by the VS command prompts.
if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
toolchain :visualcpp
else
toolchain :gcc
end
enable_debug
enable_test
# enable_bintest
ENV['ASAN_OPTIONS'] = 'atexit=true:print_stats=true'
# gembox 'full-core'
# enable_sanitizer :address, :undefined, :leak
[conf.cc, conf.cxx, conf.linker].each do |c|
c.flags <<
'-fsanitize=address,leak,undefined' <<
# '-fsanitize=thread' <<
'-Wall' << '-Wextra' << '-Wno-unused-parameter' << '-Wno-missing-field-initializers'
# c.defines << 'MRB_GC_STRESS' if c.respond_to? :defines
end
conf.cxx.flags << '-std=c++11'
conf.linker.flags << '-fuse-ld=gold'
ENV['CC'] = conf.cc.command = 'gcc-7'
ENV['CXX'] = conf.cxx.command = 'g++-7'
ENV['LD'] = conf.linker.command = 'g++-7'
ENV['LDFLAGS'] = linker.flags.flatten.join(' ')
# gem "#{MRUBY_ROOT}/mruby-"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment