Skip to content

Use explicit DLL exports on Windows#92

Merged
wravery merged 3 commits intomicrosoft:masterfrom
wravery:master
Mar 14, 2020
Merged

Use explicit DLL exports on Windows#92
wravery merged 3 commits intomicrosoft:masterfrom
wravery:master

Conversation

@wravery
Copy link
Copy Markdown
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