Skip to content

Use explicit DLL exports on Windows #92

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

Merged
merged 3 commits into from
Mar 14, 2020
Merged

Conversation

wravery
Copy link
Contributor

@wravery wravery commented Mar 14, 2020

If you used BUILD_SHARED_LIBS on Windows (including building with vcpkg by default), it was setting CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS and letting CMake figure out all of the symbols in all of the DLLs and mark them as exported. That bloats the import libs which are used to consume them and increases the binary size considerably.

This PR undoes that and replaces it with explicit __declspec(dllimport/dllimport) attributes defined conditionally through macros on Windows for the methods which are actually referenced across modules.

@wravery wravery merged commit 155a366 into microsoft:master Mar 14, 2020
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.

1 participant