summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-07-12 20:11:26 +0800
committerErik Kundiman <erik@megapahit.org>2023-07-19 15:20:25 +0800
commit7a2a5c5c0ba9d04528d909f59c2ccfac35412e15 (patch)
treee701b204a70aeeade13c019d7ad3e127ba1b9220
parent658ff1a0a14af93b96de22d3def56b93c0a5abd2 (diff)
Obtain Vorbis & Ogg flags when using system libs
On some platforms, pkg-config --libs vorbis might not necessarily imply -logg. vorbisenc & vorbisfile need their own checks anyway.
-rw-r--r--indra/cmake/Audio.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake
index 38547bb017..4c1a141dc5 100644
--- a/indra/cmake/Audio.cmake
+++ b/indra/cmake/Audio.cmake
@@ -4,6 +4,15 @@ include(Prebuilt)
include_guard()
add_library( ll::vorbis INTERFACE IMPORTED )
+if (NOT (USE_AUTOBUILD_3P OR USE_CONAN))
+ include(FindPkgConfig)
+ pkg_check_modules(Vorbis REQUIRED ogg vorbis vorbisenc vorbisfile)
+ target_include_directories(ll::vorbis SYSTEM INTERFACE ${Vorbis_INCLUDE_DIRS})
+ target_link_directories(ll::vorbis INTERFACE ${Vorbis_LIBRARY_DIRS})
+ target_link_libraries(ll::vorbis INTERFACE ${Vorbis_LIBRARIES})
+ return ()
+endif ()
+
use_system_binary(vorbis)
use_prebuilt_binary(ogg_vorbis)
target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )