-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 never creates import libraries for executables #5952
Comments
Usually executables are not used as shared libraries, which IIUC is what you need. Creating an import library for every On my pluging-based apps, the application is compiled into a dll. Plugins link to that dll. There is a tiny exe that loads and runs the dll. |
Yes, which is supposedly why |
For a cross-platform discussion see also leanprover/lean4#59 (comment). |
If ENABLE_EXPORTS does not create an export library, that's a bug, because the documentation says:
I just tried ENABLE_EXPORTS on one of my projects and the export library is not created. This is a bug that should be reported upstream. |
@Kha : if you create a bug report upstream please reference it here. Thanks. |
@oscarfv the issue could be caused by this patch: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-cmake/0007-Do-not-generate-import-libs-for-exes.patch (it was linked in the first post). |
Yes, it is only mingw cmake that breaks my build! Upstream's behavior should perhaps be changed as well, but at least it is not broken, just wasteful. |
@mati865 : without that patch cmake always generates an import library for an executable. Upstream could argue that ENABLE_EXPORTS "works" in that sense, but that's a very poor implementation. The import library should be created only when requested. Of course our patch is very relevant because the upstream bug report should not be about ENABLE_EXPORTS not creating the import library, but about the import library being created even when ENABLE_EXPORTS if OFF. |
@Kha : doing something to support a somewhat exotic use case at the expense of being wasteful for the vast majority of projects is not acceptable, IMHO, much less so when there is an easy workaround. |
Fixed in 76446f4 |
Upstream cmake always creates implibs for executables, mingw-w64-cmake never does. According to the docs, it should actually depend on
ENABLE_EXPORTS
. While this use case is rare, I believe it is the correct way to build plugin libraries that use symbols of an executable they are loaded into.Currently I'm using
as a workaround.
The text was updated successfully, but these errors were encountered: