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

Fix building as shared library with MSVC. #2527

Merged
merged 1 commit into from Sep 24, 2022

Conversation

dimztimz
Copy link
Contributor

@dimztimz dimztimz commented Sep 17, 2022

Fixes #2482.

For some more info see https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html.

For global data symbols, __declspec(dllimport) must still be used when compiling against the code in the .dll.

See also this https://cmake.org/cmake/help/latest/prop_tgt/DEFINE_SYMBOL.html . That is where the define Catch2_EXPORTS comes from.

@codecov
Copy link

codecov bot commented Sep 17, 2022

Codecov Report

Merging #2527 (63f198b) into devel (98d37da) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##            devel    #2527   +/-   ##
=======================================
  Coverage   91.56%   91.56%           
=======================================
  Files         183      183           
  Lines        7560     7560           
=======================================
  Hits         6922     6922           
  Misses        638      638           

@horenmar horenmar added the Building and Packaging Issues affecting build/packaging scripts and utilities label Sep 24, 2022
@horenmar
Copy link
Member

Thanks. I am willing to merge this now, but I'd also like to see a PR that adds a test build for the dynamic library.

@horenmar horenmar merged commit c0e582e into catchorg:devel Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Building and Packaging Issues affecting build/packaging scripts and utilities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests fail to link with v3.1.0 on windows when built as shared library
2 participants