nvim-telescope / telescope-fzf-native.nvim

FZF sorter for telescope written in c
1.36k stars 45 forks source link

CMake: build .so rather than .dylib on MacOS #73

Closed andrew-pa closed 2 years ago

andrew-pa commented 2 years ago

I tried to install on MacOS using the provided shell snippet in the README, but it seems by default CMake builds the library as libfzf.dylib, which of course then doesn't load because it expects libfzf.so:

packer.nvim: Error running config for telescope.nvim: .../start/telescope.nvim/lua/telescope/_extensions/init.lua:10: 'fzf' extension doesn't exist or isn't installed: ...k/packer/start/telescope-fzf-native.nvim/lua
/fzf_lib.lua:11: dlopen(/Users/andrew/.local/share/nvim/site/pack/packer/start/telescope-fzf-native.nvim/lua/../build/libfzf.so, 0x0005): tried: '/Users/andrew/.local/share/nvim/site/pack/packer/start/telescope-fzf-
native.nvim/lua/../build/libfzf.so' (no such file), '/Users/andrew/.local/share/nvim/site/pack/packer/start/telescope-fzf-native.nvim/build/libfzf.so' (no such file)

The provided Makefile seems to work fine, and it is easy enough to instruct CMake to build a .so instead on non-Windows platforms, which is what this PR does. Alternatively you could detect the OS in the fzf_lib.lua and add an additional branch for MacOS.

Conni2461 commented 2 years ago

Thanks :) I think its easier to change the resulting extension to .so otherwise we need to adjust the Makefile for macos and changes in lua

andrew-pa commented 2 years ago

Thanks :) I think its easier to change the resulting extension to .so otherwise we need to adjust the Makefile for macos and changes in lua

Yeah makes sense. Thank you! This extension is a great improvement for Telescope.