-
Notifications
You must be signed in to change notification settings - Fork 341
Closed
Description
I though about adding some loading mechanism with ABI version like this extracted from ruby-vips:
# Generate a library name for ffi.
#
# Platform notes:
# linux:
# Some distros allow "libvips.so", but only if the -dev headers have been
# installed. To work everywhere, you must include the ABI number.
# Confusingly, the file extension is not at the end. ffi adds the "lib"
# prefix.
# mac:
# As linux, but the extension is at the end and is added by ffi.
# windows:
# The ABI number must be included, but with a hyphen. ffi does not add a
# "lib" prefix or a ".dll" suffix.
def library_name(name, abi_number)
if FFI::Platform.windows?
"lib#{name}-#{abi_number}.dll"
elsif FFI::Platform.mac?
"#{name}.#{abi_number}"
else
"#{name}.so.#{abi_number}"
end
endFor libvips the library file names are:
libvips-42.dllon Windowslibvips.so.42on Linuxlibvips.42.dylibon Macos
This file name pattern is pretty standard on Linux and other UNIXes and the corresponding Windows pattern is getting more common these days at least on MINGW/MSYS2. Not sure how library naming is done on MSVC. They change DLL loading mechanisms every some years (SxS, explicit DLL version names, API sets). Do you know how common the MacOS-pattern is (I don't know much about MacOS)?
jirutka
Metadata
Metadata
Assignees
Labels
No labels