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

Add support for DLLs on Windows #285

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

uilianries
Copy link
Contributor

Greetings!

The CMake recommendation for RUNTIME destination is the bin folder, not lib. It occurs because it installs .dll files there and that folder will be integrated to the PATH environment.

https://cmake.org/cmake/help/latest/command/install.html#signatures

Plus, to export symbols to a DLL, CMake offers CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS which does it automatic. So you do not need to add __declspec in your code with macros.

So, when passing -DBUILD_SHARED_LIBS=ON, the cctz, when build in Windows with msvc, it should result in ${CMAKE_INSTALL_PREFIX}/lib/cctz.lib and ${CMAKE_INSTALL_PREFIX}/bin/cctz.dll, where the .lib works like a glue to load the .dll

Copy link
Contributor

@devbww devbww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@devbww devbww merged commit 2d9f3d0 into google:master Feb 20, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

4 participants