Add `enable_sanitizer` method for clang and gcc.

The patch is created by @take_cheese in #3872
parent 274884ab
......@@ -55,4 +55,12 @@ MRuby::Toolchain.new(:gcc) do |conf, _params|
@header_search_paths
end
end
def conf.enable_sanitizer(*opts)
fail 'sanitizer already set' if @sanitizer_list
@sanitizer_list = opts
flg = "-fsanitize=#{opts.join ','}"
[self.cc, self.cxx, self.linker].each{|cmd| cmd.flags << flg }
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment