SFML / CSFML

Official binding of SFML for C
https://www.sfml-dev.org
Other
342 stars 121 forks source link

Copy SFML DLLs alongside test executables #298

Closed ChrisThrasher closed 1 week ago

ChrisThrasher commented 1 week ago

For reasons I don't entirely understand, it's possible for the build to fail when trying to copy DLLs into the same directory as the test executable. This problem was recreated locally by Kimci86 but never affected CSFML's CI pipeline until some time after #291 was merged which added even more DLLs into the mix being copied.

This fix uses a more straightforward solution to address DLL issues. The CMAKE_RUNTIME_OUTPUT_DIRECTORY variable is used to ensure all EXEs and DLLs built within this project are placed into the same directory. However SFML still has 5 more DLLs to copy so I use a loop to create five more commands that copy those DLLs one by one into the same directory as the rest of the EXEs and DLLs.

For now we only strictly need the DLLs for the System, Window, and Network modules but in the future I hope to add tests for Graphics and Audio so I thought it was reasonable to go ahead and copy those DLLs as well.