Skip to content

Commit 275fe38

Browse files
authored
Merge pull request #166 from michaelglass/patch-1
disable lto flag for darwin + nix
2 parents 140bfd8 + eb02996 commit 275fe38

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
@@ -24,7 +24,12 @@
2424
$CXXFLAGS << ' -march=native -mtune=native'
2525
end
2626

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

0 commit comments

Comments
 (0)