libfort
libfort copied to clipboard
CMake build does not generate .lib
Hi,
I am trying to integrate libfort as part of a project built using CMake. I would like to link to it either statically by using a .lib file, or dynamically but with exports linked through a .lib file also.
I can't figure out how to build libfort one way or the other using CMake. All I've managed is to generate a .dll file alone.
Any pointers ?
Thanks !
Here's a workaround I found :
# Workaround to force symbol export
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
include(FetchContent)
FetchContent_Declare(libfort
GIT_REPOSITORY https://github.com/seleznevae/libfort.git
GIT_TAG v0.4.2
STEP_TARGETS build
)
FetchContent_MakeAvailable(libfort)
# Workaround to force symbol export
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS FALSE)
But I think it would be better to have dllexport directives in the source code directly.