Skip to content

Commit

Permalink
Use libc++ on Mojave (fixes #96)
Browse files Browse the repository at this point in the history
Using libstdc++ is deprecated on macOS 10.14, therefore selectively
build against libc++ based on the reported platform version. Since this
platform check is persisted upon ruby being built, building will fail if
a given ruby is built before upgrading to Mojave and this gem is
subsequently attempted to be installed.
  • Loading branch information
lloeki committed Aug 28, 2018
1 parent ab88c73 commit 2086db1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/mini_racer_extension/extconf.rb
Expand Up @@ -11,7 +11,7 @@
$CPPFLAGS += " -fpermissive"
$CPPFLAGS += " -Wno-reserved-user-defined-literal" if RUBY_PLATFORM =~ /darwin/

$LDFLAGS.insert 0, " -stdlib=libstdc++ " if RUBY_PLATFORM =~ /darwin/
$LDFLAGS.insert 0, $1.to_i < 18 ? " -stdlib=libstdc++ " : " -stdlib=libc++ " if RUBY_PLATFORM =~ /darwin(\d+)/

if ENV['CXX']
puts "SETTING CXX"
Expand Down

0 comments on commit 2086db1

Please sign in to comment.