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 shared libraries for Windows environments #224

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

synthetic-borealis
Copy link

This pull request makes some changes to src/CMakeLists.txt that ensure shared libraries build and install correctly on Windows environments.
The changes I made are:

  • set(CMAKE_SHARED_LIBRARY_PREFIX ) - Prevent DLL files from having a prefix added to their name (i.e. libSDL_gpu.dll when it should be SDL_gpu.dll) when building with MinGW.
  • target_compile_definitions(SDL_gpu_shared PUBLIC DLL_EXPORT) - Ensure DLL files export symbols and import libraries are generated when compiled with Visual Studio/Microsoft C++.
  • install(TARGETS SDL_gpu_shared EXPORT SDL_gpu-targets LIBRARY DESTINATION lib) - Install DLL files in the bin directory and *.lib/*.a files in the lib directory.

@l-t-m-f
Copy link

l-t-m-f commented Nov 27, 2022

The .dll and .a files are still not being properly created by Mingw. The only way to obtain .dll and .a files from a Mingw compilation currently in my attempts is through MSYS2. I have done so here. If you require 0.12 librairies for Windows, use this build it should work: https://github.com/l-t-m-f/SDL2_gpu-0.12.0-mingw64.zip

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.

2 participants