Skip to content

Commit 28aa5c7

Browse files
committed
Use RbConfig::MAKEFILE_CONFIG['DLEXT'] instead of hardcoding extensions
* Since libsass is meant to be used with FFI, RbConfig::CONFIG['SOEXT'] would be better, but DLEXT is used as libsass is compiled by mkmf (#127). * Use RbConfig::MAKEFILE_CONFIG['DLEXT'] instead of just RbConfig::CONFIG['DLEXT'] so it's also correct on JRuby and not 'jar'. See https://github.com/rake-compiler/rake-compiler/blob/f808dd7a/lib/rake/extensiontask.rb#L41 * This lets Ruby implementations use another file extension than .so/.bundle for C extensions. For example, TruffleRuby 19.3.0 uses .dylib on macOS. * Some OS also use a different file extension, such as HPUX which uses .sl.
1 parent 8b6f415 commit 28aa5c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/sassc/native.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module SassC
66
module Native
77
extend FFI::Library
88

9-
dl_ext = (RbConfig::CONFIG['host_os'] =~ /darwin/ ? 'bundle' : 'so')
9+
dl_ext = RbConfig::MAKEFILE_CONFIG['DLEXT']
1010
begin
1111
ffi_lib File.expand_path("libsass.#{dl_ext}", __dir__)
1212
rescue LoadError # Some non-rvm environments don't copy a shared object over to lib/sassc

0 commit comments

Comments
 (0)