From 1e436be51d4f8853c3494a0753eabe7628ac6d90 Mon Sep 17 00:00:00 2001 From: locriacyber <74560659+locriacyber@users.noreply.github.com> Date: Sat, 5 Feb 2022 13:33:05 +0100 Subject: [PATCH] Make audio examples compile with external glfw on Linux (#2329) --- cmake/LibraryConfigurations.cmake | 4 ++++ src/CMakeLists.txt | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake index b7874888f..9227aef0d 100644 --- a/cmake/LibraryConfigurations.cmake +++ b/cmake/LibraryConfigurations.cmake @@ -28,6 +28,10 @@ if (${PLATFORM} MATCHES "Desktop") endif () set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY}) + + if (USE_AUDIO) + set(LIBS_PRIVATE ${LIBS_PRIVATE} dl) + endif () endif () elseif (${PLATFORM} MATCHES "Web") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2877c9ac8..c96f4f560 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,6 +41,10 @@ set(raylib_sources # /cmake/GlfwImport.cmake handles the details around the inclusion of glfw include(GlfwImport) +# Sets additional platform options and link libraries for each platform +# also selects the proper graphics API and version for that platform +# Produces a variable LIBS_PRIVATE that will be used later +include(LibraryConfigurations) if (USE_AUDIO) MESSAGE(STATUS "Audio Backend: miniaudio") @@ -49,10 +53,6 @@ else () MESSAGE(STATUS "Audio Backend: None (-DUSE_AUDIO=OFF)") endif () -# Sets additional platform options and link libraries for each platform -# also selects the proper graphics API and version for that platform -# Produces a variable LIBS_PRIVATE that will be used later -include(LibraryConfigurations) add_library(raylib ${raylib_sources} ${raylib_public_headers})