Browse Source

Make audio examples compile with external glfw on Linux (#2329)

locriacyber 3 years ago
parent
commit
1e436be51d
2 changed files with 8 additions and 4 deletions
  1. 4 0
      cmake/LibraryConfigurations.cmake
  2. 4 4
      src/CMakeLists.txt

+ 4 - 0
cmake/LibraryConfigurations.cmake

@@ -28,6 +28,10 @@ if (${PLATFORM} MATCHES "Desktop")
         endif ()
         endif ()
         
         
         set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
         set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
+
+        if (USE_AUDIO)
+            set(LIBS_PRIVATE ${LIBS_PRIVATE} dl)
+        endif ()
     endif ()
     endif ()
 
 
 elseif (${PLATFORM} MATCHES "Web")
 elseif (${PLATFORM} MATCHES "Web")

+ 4 - 4
src/CMakeLists.txt

@@ -41,6 +41,10 @@ set(raylib_sources
 # <root>/cmake/GlfwImport.cmake handles the details around the inclusion of glfw
 # <root>/cmake/GlfwImport.cmake handles the details around the inclusion of glfw
 include(GlfwImport)
 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)
 if (USE_AUDIO)
     MESSAGE(STATUS "Audio Backend: miniaudio")
     MESSAGE(STATUS "Audio Backend: miniaudio")
@@ -49,10 +53,6 @@ else ()
     MESSAGE(STATUS "Audio Backend: None (-DUSE_AUDIO=OFF)")
     MESSAGE(STATUS "Audio Backend: None (-DUSE_AUDIO=OFF)")
 endif ()
 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})
 add_library(raylib ${raylib_sources} ${raylib_public_headers})