libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Statically linking an executable with GME enabled breaks the build at link time

nightmareci opened this issue · comments

I'm working on a project where I want to CMake-consume (via FetchContent), build, and statically link all the dependencies (SDL, all the satellite libraries) for distributed release builds. Enabling GME breaks the build though, as it needs C++, and C++ doesn't get enabled properly in this setup, so the build output throws a bunch of C++ linking errors. For now, adding an enable_language(CXX) gets it working, but that doesn't really seem correct, I don't think a CMake project (mine) consuming another (SDL_mixer) should have to do that, if my project's code doesn't include any C++. So, somehow, C++ needs to get enabled so the final statically linked executable can get the C++ code linked in.

I've encountered this bug with both SDL2 and SDL3.