mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 21:34:09 +00:00
Bug 682071-cogl/cogl-sdl.h: MSVC: Link to SDL when apps are built
Link to SDL.lib and SDLmain.lib if Cogl was built with the SDL winsys. Recent changes to the SDL winsys introduced a direct dependency to SDLmain.lib (and hence SDL.lib) when programs are built, causing linker errors to appear when any programs using cogl (with the SDL winsys built in) are built. Since we cannot determine whether a Cogl build is built with the SDL winsys at build time easily, we could use #pragma comment (lib, ...) whenever cogl-sdl.h is included by cogl.h so that SDLmain.lib and SDL.lib is linked into the resulting binary, so that the program can link and run correctly. This does not add any external dependencies as the Cogl DLL already depends on SDL.dll when it is built with the SDL winsys.
This commit is contained in:
parent
f904f2099a
commit
b743d95e21
@ -31,6 +31,15 @@
|
||||
#include <cogl/cogl-context.h>
|
||||
#include <SDL.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* We need to link to SDL.lib/SDLmain.lib
|
||||
* if we are using Cogl
|
||||
* that uses the SDL winsys
|
||||
*/
|
||||
#pragma comment (lib, "SDL.lib")
|
||||
#pragma comment (lib, "SDLmain.lib")
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user