-
Notifications
You must be signed in to change notification settings - Fork 141
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
Now CMake will build both static and shared libs #953
Conversation
Tested to be good under Ubuntu 20.04 x64. |
Alas, it doesn't build for Windows and MacOS - see logfiles above. |
The current shared build under Windows is broken anyway. This pull request does not sorted out the issue. |
I don't have a windows machine nearby. Can somebody check why the msvc build is failing? |
See the CI toolchain builds. |
Well... I didn't actually get it to work. I just worked around it 😅 It looks like macOS Once #954 is fixed, I guess macOS shared library shall also work 🤷
I did, and it looks like some dependencies (libelf, libftdi, etc) aren't being built. Dunno why though. |
The current Windows CI VS build is very special (unlike any CMake based projects I know of). But I think there should be a way to get the macOS build right. FYI libftdi CMake build (with both static and shared library) works for macOS. Edit: this may not be correct as it may well be in the same situation as Windows. |
Indeed. The error message seems to be very much similar to Windows if I enable shared build under macOS using your patch.
|
However, note that the classic autoconf/automake approach had no problems creating a shared lib under MacOS. I've posted the different linker commands here: |
Regarding Windows DLLs, I see DLLimport and DLLexport in the Microsoft docs. That ought to be able to solve the WinAPI issue, I think. |
That is a good point. Indeed I have no issues to build the shared lib under macOS (once I use the correct ./configure) using the release auto-tool tarball. So probably there is a easier way out for macOS compared to Windows. |
This. This is why autotools doesn't complain but CMake does
|
Now the error messages of macOS build and Windows build are the same with the latest version (commit 439f695). |
I'm closing this PR for now. Might come back later when I have more time to invest on this. |
This PR has been succeeded by #960, because GitHub doesn't allow me to re-open this PR. |
Closes #952