Skip to content

Commit

Permalink
disable lto flag for darwin + nix
Browse files Browse the repository at this point in the history
see sass#148 for more context

thanks @michaelglass
  • Loading branch information
emptyflask committed Dec 17, 2019
1 parent 7cbb577 commit 17c2ab6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ext/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
$CXXFLAGS << ' -march=native -mtune=native'
end

if enable_config('lto', true)
# darwin nix clang doesn't support lto
# disable -lto flag for darwin + nix
# see: https://github.com/sass/sassc-ruby/issues/148
enable_lto_by_default = (Gem::Platform.local.os == "darwin" && ENV['NIX_CC'].nil?)

if enable_config('lto', enable_lto_by_default)
$CFLAGS << ' -flto'
$CXXFLAGS << ' -flto'
$LDFLAGS << ' -flto'
Expand Down

0 comments on commit 17c2ab6

Please sign in to comment.