Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set ext.no_native = true for non mac platform #4553

Merged
merged 1 commit into from
Apr 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Set ext.no_native = true for non mac platform
  • Loading branch information
liujisi committed Apr 25, 2018
commit 9972e1608e83ca8489d7415d6f55e67fb4a079ca
6 changes: 6 additions & 0 deletions ruby/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ if RUBY_PLATFORM == "java"
end
else
Rake::ExtensionTask.new("protobuf_c", spec) do |ext|
unless RUBY_PLATFORM =~ /darwin/
# TODO: also set "no_native to true" for mac if possible. As is,
# "no_native" can only be set if the RUBY_PLATFORM doing
# cross-compilation is contained in the "ext.cross_platform" array.
ext.no_native = true
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this also needs

ext.cross_compiling do |spec|
  s.files       = Dir.glob('lib/**/*.rb')
end

to get keep the .rb files in the binary packages, without the .c files.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scratch my above comment. That is optional, and is only useful if you want to also want to remove source code from the binary packages.

ext.ext_dir = "ext/google/protobuf_c"
ext.lib_dir = "lib/google"
ext.cross_compile = true
Expand Down