-
Notifications
You must be signed in to change notification settings - Fork 69
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
Linking to bcrypt creates problems (i.e. for CMake users) #122
Comments
I'm not the maintainer, but linking with bcrypt is essential. The alternative is wincrypt, but it is deprecated and I don't think is universally available. I also don't think introducing a dummy compiled library is an adequate solution, as this creates a bunch of other problems. For example, it affects packaging and downstream dependencies for no good reason. IMHO, this should be solved entirely in CMake and headers. One option is stop defining |
Relying on autolink to hide the problem doesn't seem correct; it doesn't work for GCC. But assuming we don't care about GCC, we've had the discussion of whether BOOST_ALL_NO_LIB should apply to non-Boost libraries more than once now, without any results. I wouldn't be in support of enabling autolink for Boost libraries when using the CMake config files; this causes nothing but trouble (even if it does help to hide errors occasionally.) |
Yes, enabling auto-link is just a workaround, something we could consider for 1.78. The proper solution is to find a way to generate CMake config files for header-only libraries while keeping them header-only. |
I would love to see this, so I can use Boost::uuid and others to correctly link all targets. In case of other libraries like Boost libraries, I also need to link other boost libraries explicitly like filesystem, which is confusing. Should this maybe tracked in a separate issue? Perhaps in boost_install? |
I'm guessing someone has a workaround for this, for now - it might be useful to share that to help others in the same situation. |
I changed the CMake config files to only define the corresponding library-specific _NO_LIB macro instead of |
@pdimov is there anything that needs to be done here as a result of that? |
I don't think we can do anything in practice, short of switching to a compiled library, which is unacceptable for many. So, closing. |
Thanks, worked hard to keep this header-only. |
As reported in boostorg/boost_install#54, using UUID from a CMake project requires one to manually link to bcrypt on Windows. That's because the CMake config files define
BOOST_ALL_NO_LIB
, which disables autolinking not just to Boost libraries (which is the intent), but to bcrypt.lib as well.In addition, since UUID is a header-only library, it has no CMake target to which code could link in order to inherit the dependency to bcrypt.
If we're intending to keep linking to bcrypt, one option here is to create a dummy compiled library, whose only purpose would be to expose a Boost::uuid target in CMake, which would then link to bcrypt.
The text was updated successfully, but these errors were encountered: