Don't link against dl with NO_RUNTIME_LINKING.

This commit is contained in:
David Reid
2025-07-21 17:06:34 +10:00
parent 79b4ddc27d
commit c48975f4a9
+2
View File
@@ -450,11 +450,13 @@ endif()
set(COMMON_LINK_LIBRARIES) set(COMMON_LINK_LIBRARIES)
if (UNIX) if (UNIX)
if(NOT MINIAUDIO_NO_RUNTIME_LINKING)
# Not all platforms actually use a separate "dl" library, notably NetBSD and OpenBSD. # Not all platforms actually use a separate "dl" library, notably NetBSD and OpenBSD.
find_library(LIB_DL "dl") find_library(LIB_DL "dl")
if(LIB_DL) if(LIB_DL)
list(APPEND COMMON_LINK_LIBRARIES dl) # For dlopen(), etc. Most compilers will link to this by default, but some may not. list(APPEND COMMON_LINK_LIBRARIES dl) # For dlopen(), etc. Most compilers will link to this by default, but some may not.
endif() endif()
endif()
list(APPEND COMMON_LINK_LIBRARIES pthread) # Some compilers will not link to pthread by default so list it here just in case. list(APPEND COMMON_LINK_LIBRARIES pthread) # Some compilers will not link to pthread by default so list it here just in case.
list(APPEND COMMON_LINK_LIBRARIES m) list(APPEND COMMON_LINK_LIBRARIES m)