Skip to content

Commit 6cddead

Browse files
committed
Use unprefixed SDL include paths for SDL2 and SDL1
When SDL2 is built from source or provided via CMake targets, the include path points directly to the headers directory, so <SDL.h> works but <SDL2/SDL.h> does not. The <SDL2/...> form only works with system pkg-config installs that add the parent directory. Use the unprefixed form for SDL2 and SDL1 which is compatible with both CMake-target and system-install include path layouts. SDL3 retains the <SDL3/...> prefix as that is the canonical form established by the SDL3 project.
1 parent b9b9808 commit 6cddead

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

include/mpqfs/mpqfs.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@
6161
# include <SDL3/SDL_iostream.h>
6262
# include <SDL3/SDL.h>
6363
#elif defined(MPQFS_USE_SDL2) && MPQFS_USE_SDL2
64-
# include <SDL2/SDL_rwops.h>
65-
# include <SDL2/SDL.h>
64+
# include <SDL_rwops.h>
65+
# include <SDL.h>
6666
#elif defined(MPQFS_USE_SDL1) && MPQFS_USE_SDL1
67-
# include <SDL/SDL_rwops.h>
68-
# include <SDL/SDL.h>
67+
# include <SDL_rwops.h>
68+
# include <SDL.h>
6969
#endif
7070

7171
/* -----------------------------------------------------------------------

src/mpq_sdl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
#if MPQFS_SDL_VERSION == 3
3333
#include <SDL3/SDL.h>
3434
#elif MPQFS_SDL_VERSION == 2
35-
#include <SDL2/SDL.h>
35+
#include <SDL.h>
3636
#else
37-
#include <SDL/SDL.h>
38-
#include <SDL/SDL_rwops.h>
37+
#include <SDL.h>
38+
#include <SDL_rwops.h>
3939
#endif
4040

4141
/* -----------------------------------------------------------------------

0 commit comments

Comments
 (0)