mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00

When both extconf.rb of generator and parser are run in one process,
the second `require_relative` does nothing.
8e775320b7
16 lines
469 B
Ruby
16 lines
469 B
Ruby
require 'mkmf'
|
|
|
|
if RUBY_ENGINE == 'truffleruby'
|
|
# The pure-Ruby generator is faster on TruffleRuby, so skip compiling the generator extension
|
|
File.write('Makefile', dummy_makefile("").join)
|
|
else
|
|
append_cflags("-std=c99")
|
|
$defs << "-DJSON_GENERATOR"
|
|
$defs << "-DJSON_DEBUG" if ENV["JSON_DEBUG"]
|
|
|
|
if enable_config('generator-use-simd', default=!ENV["JSON_DISABLE_SIMD"])
|
|
load __dir__ + "/../simd/conf.rb"
|
|
end
|
|
|
|
create_makefile 'json/ext/generator'
|
|
end
|