Skip to content

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