Skip to content

Commit eb02996

Browse files
authored
disable lto flag for darwin + nix
see #148 for more context
1 parent 8b6f415 commit eb02996

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ext/extconf.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525
$CXXFLAGS << ' -march=native -mtune=native'
2626
end
2727

28-
if enable_config('lto', true)
28+
# darwin nix clang doesn't support lto
29+
# disable -lto flag for darwin + nix
30+
# see: https://github.com/sass/sassc-ruby/issues/148
31+
enable_lto_by_default = (Gem::Platform.local.os == "darwin" && !ENV['NIX_CC'].nil?)
32+
33+
if enable_config('lto', enable_lto_by_default)
2934
$CFLAGS << ' -flto'
3035
$CXXFLAGS << ' -flto'
3136
$LDFLAGS << ' -flto'

0 commit comments

Comments
 (0)