nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch
2022-03-20 16:07:38 +08:00

34 lines
1.1 KiB
Diff

diff --git a/sdl2-config.cmake.in b/sdl2-config.cmake.in
index c570511fa..ca694f595 100644
--- a/sdl2-config.cmake.in
+++ b/sdl2-config.cmake.in
@@ -7,7 +7,8 @@ set(includedir "@includedir@")
set(SDL2_PREFIX "${prefix}")
set(SDL2_EXEC_PREFIX "${exec_prefix}")
set(SDL2_LIBDIR "${libdir}")
-set(SDL2_INCLUDE_DIRS "${includedir}/SDL2")
+set(SDL2_INCLUDE_DIRS "${includedir}/SDL2" $ENV{SDL2_PATH})
+separate_arguments(SDL2_INCLUDE_DIRS)
set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} @SDL_RLD_FLAGS@ @SDL_LIBS@")
string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
diff --git a/sdl2-config.in b/sdl2-config.in
index 5a2aed292..7c55f0a28 100644
--- a/sdl2-config.in
+++ b/sdl2-config.in
@@ -42,7 +42,11 @@ while test $# -gt 0; do
echo @SDL_VERSION@
;;
--cflags)
- echo -I@includedir@/SDL2 @SDL_CFLAGS@
+ SDL_CFLAGS=""
+ for i in @includedir@/SDL2 $SDL2_PATH; do
+ SDL_CFLAGS="$SDL_CFLAGS -I$i"
+ done
+ echo $SDL_CFLAGS @SDL_CFLAGS@
;;
@ENABLE_SHARED_TRUE@ --libs)
@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
--
2.33.1