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

Simplify mkmf-rice, part 2 #212

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
include:
- os: ubuntu-20.04
ruby: '3.1'
- os: macos-13
ruby: '3.0'
exclude:
# There's something wrong with this setup in GHA such that
# it gets weird linking errors, however I'm unable to reproduce
Expand Down
14 changes: 5 additions & 9 deletions lib/mkmf-rice.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'mkmf'

IS_MSWIN = RbConfig::CONFIG['host_os'].match?(/mswin/)
IS_MINGW = RbConfig::CONFIG['host_os'].match?(/mingw/)
IS_MSWIN = /mswin/ =~ RUBY_PLATFORM
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh I meant actually using the $constants defined my mkmf already. Unless their and not accessible from the extconf.rb file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, seems like they should be accessible. Feel free to update in a follow-up commit.

IS_MINGW = /mingw/ =~ RUBY_PLATFORM
IS_DARWIN = RbConfig::CONFIG['host_os'].match?(/darwin/)

# The cpp_command is not overwritten in the experimental mkmf C++ support.
Expand Down Expand Up @@ -38,10 +38,6 @@ def cpp_command(outfile, opt="")
raise("Could not find rice/rice.hpp header")
end

if IS_DARWIN
have_library('c++')
elsif !IS_MSWIN
if !have_library('stdc++fs')
have_library('stdc++')
end
end
if !IS_DARWIN && !IS_MSWIN && !have_library('stdc++fs')
have_library('stdc++')
end