Commit 430c39082f3333540d0f48a5ae1e65c1e41dd549

Anonymous Maarten 2022-07-25T23:35:59

ci: test 'sdl2-config --static-libs' + 'pkg-config sdl2 --static' on ci

diff --git a/cmake/test/test_pkgconfig.sh b/cmake/test/test_pkgconfig.sh
index 2c58a75..944fb2b 100755
--- a/cmake/test/test_pkgconfig.sh
+++ b/cmake/test/test_pkgconfig.sh
@@ -27,20 +27,25 @@ set -e
 testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
 CFLAGS="$( pkg-config sdl2 --cflags )"
 LDFLAGS="$( pkg-config sdl2 --libs )"
+STATIC_LDFLAGS="$( pkg-config sdl2 --libs --static )"
 
 compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $CFLAGS $EXTRA_CFLAGS"
 link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $LDFLAGS $EXTRA_LDFLAGS"
+static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $STATIC_LDFLAGS $EXTRA_LDFLAGS"
 
-echo "-- CC:            $CC"
-echo "-- CFLAGS:        $CFLAGS"
-echo "-- EXTRA_CFLAGS:  $EXTRA_CFLAGS"
-echo "-- LDFLASG:       $LDFLAGS"
-echo "-- EXTRA_LDFLAGS: $EXTRA_LDFLAGS"
+echo "-- CC:                $CC"
+echo "-- CFLAGS:            $CFLAGS"
+echo "-- EXTRA_CFLAGS:      $EXTRA_CFLAGS"
+echo "-- LDFLASG:           $LDFLAGS"
+echo "-- STATIC_LDFLAGS:    $STATIC_LDFLAGS"
+echo "-- EXTRA_LDFLAGS:     $EXTRA_LDFLAGS"
 
-echo "-- COMPILE: $compile_cmd"
-echo "-- LINK:    $link_cmd"
+echo "-- COMPILE:       $compile_cmd"
+echo "-- LINK:          $link_cmd"
+echo "-- STATIC_LINK:   $static_link_cmd"
 
 set -x
 
 $compile_cmd
 $link_cmd
+$static_link_cmd
diff --git a/cmake/test/test_sdlconfig.sh b/cmake/test/test_sdlconfig.sh
index ca09bc2..76c620d 100755
--- a/cmake/test/test_sdlconfig.sh
+++ b/cmake/test/test_sdlconfig.sh
@@ -27,20 +27,25 @@ set -e
 testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
 CFLAGS="$( sdl2-config --cflags )"
 LDFLAGS="$( sdl2-config --libs )"
+STATIC_LDFLAGS="$( sdl2-config --static-libs )"
 
 compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_sdlconfig.c.o $CFLAGS $EXTRA_CFLAGS"
 link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig${EXESUFFIX} $LDFLAGS $EXTRA_LDFLAGS"
+static_link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig_static${EXESUFFIX} $STATIC_LDFLAGS $EXTRA_LDFLAGS"
 
-echo "-- CC:            $CC"
-echo "-- CFLAGS:        $CFLAGS"
-echo "-- EXTRA_CFLAGS:  $EXTRA_CFLAGS"
-echo "-- LDFLASG:       $LDFLAGS"
-echo "-- EXTRA_LDFLAGS: $EXTRA_LDFLAGS"
+echo "-- CC:                $CC"
+echo "-- CFLAGS:            $CFLAGS"
+echo "-- EXTRA_CFLAGS:      $EXTRA_CFLAGS"
+echo "-- LDFLAGS:           $LDFLAGS"
+echo "-- STATIC_LDFLAGS:    $STATIC_LDFLAGS"
+echo "-- EXTRA_LDFLAGS:     $EXTRA_LDFLAGS"
 
-echo "-- COMPILE: $compile_cmd"
-echo "-- LINK:    $link_cmd"
+echo "-- COMPILE:       $compile_cmd"
+echo "-- LINK:          $link_cmd"
+echo "-- STATIC_LINK:   $static_link_cmd"
 
 set -x
 
 $compile_cmd
 $link_cmd
+$static_link_cmd