SDL_mixer: cmake: add -Wl,--no-undefined if compiler supports it

From ae6bf6e7a48ea4b7e068b44569de6c53814632bd Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sun, 26 Mar 2023 19:20:50 +0200
Subject: [PATCH] cmake: add -Wl,--no-undefined if compiler supports it

---
 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9eb62ba5..583e1bb2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -302,6 +302,10 @@ if(SDL3MIXER_BUILD_SHARED_LIBS)
     set_property(TARGET SDL3_mixer APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SDL3_SHARED)
 endif()
 
+if(SDL3MIXER_BUILD_SHARED_LIBS)
+    sdl_target_link_options_no_undefined(SDL3_mixer)
+endif()
+
 if(SDL3MIXER_BUILD_SHARED_LIBS)
     # Make sure static library dependencies are built with -fPIC when building a shared SDL3_mixer
     set(CMAKE_POSITION_INDEPENDENT_CODE ON)