Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake build does not generate .lib #66

Open
rshamsnejad opened this issue Dec 3, 2021 · 1 comment
Open

CMake build does not generate .lib #66

rshamsnejad opened this issue Dec 3, 2021 · 1 comment

Comments

@rshamsnejad
Copy link

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 !

@rshamsnejad
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant