From 116ec19527bd2c41e995966cc3d618cfd49e63f4 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 30 Mar 2025 08:50:46 -0700
Subject: [PATCH] Use '-' instead of '_' in pkgconfig file
This is consistent with other SDL3 libraries, following https://github.com/libsdl-org/SDL/issues/6713
Fixes https://github.com/libsdl-org/sdl2-compat/issues/439
---
CMakeLists.txt | 4 ++--
cmake/test/test_pkgconfig.sh | 6 +++---
sdl2_compat.pc.in => sdl2-compat.pc.in | 0
3 files changed, 5 insertions(+), 5 deletions(-)
rename sdl2_compat.pc.in => sdl2-compat.pc.in (100%)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ae4072f..00e54f59 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -599,8 +599,8 @@ if(SDL2COMPAT_INSTALL)
set(ENABLE_SHARED_TRUE "")
set(ENABLE_SHARED_FALSE "#")
- configure_file(sdl2_compat.pc.in sdl2_compat.pc @ONLY)
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sdl2_compat.pc"
+ configure_file(sdl2-compat.pc.in sdl2-compat.pc @ONLY)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sdl2-compat.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
diff --git a/cmake/test/test_pkgconfig.sh b/cmake/test/test_pkgconfig.sh
index 661841a9..3abf96b7 100755
--- a/cmake/test/test_pkgconfig.sh
+++ b/cmake/test/test_pkgconfig.sh
@@ -30,10 +30,10 @@ fi
# Get the canonical path of the folder containing this script
testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
-SDL_CFLAGS="$( pkg-config sdl2_compat --cflags )"
-SDL_LDFLAGS="$( pkg-config sdl2_compat --libs )"
+SDL_CFLAGS="$( pkg-config sdl2-compat --cflags )"
+SDL_LDFLAGS="$( pkg-config sdl2-compat --libs )"
if [ "x$test_static" = "xyes" ]; then
- SDL_STATIC_LDFLAGS="$( pkg-config sdl2_compat --libs --static )"
+ SDL_STATIC_LDFLAGS="$( pkg-config sdl2-compat --libs --static )"
fi
compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $SDL_CFLAGS $CFLAGS"
diff --git a/sdl2_compat.pc.in b/sdl2-compat.pc.in
similarity index 100%
rename from sdl2_compat.pc.in
rename to sdl2-compat.pc.in