nvim-telescope / telescope-fzf-native.nvim

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

Building FZF on windows with clang and MSVC toolchain generates libfzf.so #77

Closed bruxisma closed 1 year ago

bruxisma commented 2 years ago

To recreate, install cmake, ninja, MSVC Build tools, Clang 14 from llvm.org and run the build. You'll see that it generates a .so instead of a .dll

Suggestion for a fix is to replace the set(CMAKE_SHARED_LIBRARY_SUFFIX .so) call with a new line for set_target_properties

set_target_properties(${PROJECT_NAME} PROPERTIES
    PREFIX lib
    # This line specifically
    SUFFIX $<$<NOT:$<STREQUAL:${CMAKE_SYSTEM_NAME},Windows>>.so>
    C_STANDARD 99
    WINDOWS_EXPORT_ALL_SYMBOLS ON
)

This adds a generator expression that will only set .so (during generation time) if the targeted system is not Windows.

Conni2461 commented 2 years ago

PR welcome :)

bruxisma commented 2 years ago

I've opened a PR, and fixed a few other issues as well. (Also thanks for making this project. Saves me a ton of time!!)