Skip to content

Commit

Permalink
Actually just skip everything for json (the top level one)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed May 6, 2024
1 parent 0f6e2b3 commit 8274026
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions lib/rubygems_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ def post_install
elsif extname.to_s == "sqlite3"
extname = "sqlite3_native"
extconf_args = ["--enable-system-libraries", "--with-pkg-config=pkgconf"]
elsif ['unfext', 'byebug', 'msgpack', 'json', 'generator', 'parser'].include?(extname.to_s)
elsif extname.to_s == 'json'
# json has a makefile, but really it's only json/ext/parser and
# json/ext/generator that are compiled
puts "Not exporting json because it's shallow and doesn't have a static lib (parser and generator do). #{extension_dir.to_s}"
next
elsif ['unfext', 'byebug', 'msgpack', 'generator', 'parser'].include?(extname.to_s)
# No-op
else
puts "Warning: rubygems_plugin.post_install: no configuration given for extension_dir=#{extension_dir}"
Expand Down Expand Up @@ -148,30 +153,24 @@ def post_install

StaticExtensionPlugin.make_static extension_dir, results

# json has a makefile, but really it's only json/ext/parser and
# json/ext/generator that are compiled
if extname.to_s == 'json'
puts "Not exporting json because it's shallow and doesn't have a static lib (parser and generator do). #{extension_dir.to_s}"
else
File.open(@ext_init_file_name, "a") do |f|
f.puts "extern \"C\" {"
f.puts " void Init_#{extname}(void);"
f.puts "}"
f.puts
f.puts "namespace embedded_help {"
f.puts " inline void init_#{extname}() {"
f.puts " Init_#{extname}();"
f.puts " }"
f.puts "}"
f.puts
end
File.open(@ext_init_file_name, "a") do |f|
f.puts "extern \"C\" {"
f.puts " void Init_#{extname}(void);"
f.puts "}"
f.puts
f.puts "namespace embedded_help {"
f.puts " inline void init_#{extname}() {"
f.puts " Init_#{extname}();"
f.puts " }"
f.puts "}"
f.puts
end

File.open(@exports_file_name, "a") do |f|
f.puts "add_library(#{target_name} STATIC IMPORTED)"
f.puts "set_target_properties(#{target_name} PROPERTIES IMPORTED_LOCATION \"${OPENSTUDIO_GEMS_DIR}#{lib_path}\")"
f.puts "list(APPEND ruby_extension_libs #{target_name})"
f.puts
end
File.open(@exports_file_name, "a") do |f|
f.puts "add_library(#{target_name} STATIC IMPORTED)"
f.puts "set_target_properties(#{target_name} PROPERTIES IMPORTED_LOCATION \"${OPENSTUDIO_GEMS_DIR}#{lib_path}\")"
f.puts "list(APPEND ruby_extension_libs #{target_name})"
f.puts
end
end
end
Expand Down

0 comments on commit 8274026

Please sign in to comment.