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

Manage export for static library under Windows #161

Merged
merged 2 commits into from
Mar 21, 2020

Conversation

HerveAncher
Copy link
Contributor

Under Windows, with previous code, all objects were exported with the flag __declspec(dllexport), and imported with __declspec(dllimport).

It works well when you link with dynamic library (and its import library) but failed when you try to link with the new static library.

To fix that, I added a new flag named BZ_STATIC_LIB which is defined during static library compilation (see CMakeLists.txt).
This flag need to be also be added in third party software when user want to link with static library under Windows, for example in CXXFLAGS: -DBZ_STATIC_LIB

This PR do not impact the dynamic linking, which is the standard behavior.

It will be possible to add the flag in CMake config file to automatize the definition of it.
Also in pkg-config generated file.

@HerveAncher
Copy link
Contributor Author

I have just push a commit allow to export static flags for Windows and MinGW

@HerveAncher HerveAncher marked this pull request as ready for review March 19, 2020 14:00
@slayoo slayoo merged commit 839fc5e into blitzpp:master Mar 21, 2020
@slayoo
Copy link
Member

slayoo commented Mar 21, 2020

Thank you!

@slayoo
Copy link
Member

slayoo commented Mar 21, 2020

Could you please comment if this is in anyway relevant to an apparently related issue:
#147

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.

None yet

2 participants