aboutsummaryrefslogtreecommitdiff
path: root/CMakeModules/find/FindOpus.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeModules/find/FindOpus.cmake')
-rw-r--r--CMakeModules/find/FindOpus.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/CMakeModules/find/FindOpus.cmake b/CMakeModules/find/FindOpus.cmake
new file mode 100644
index 0000000000..257642682e
--- /dev/null
+++ b/CMakeModules/find/FindOpus.cmake
@@ -0,0 +1,22 @@
+# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+find_package(PkgConfig QUIET)
+pkg_search_module(OPUS QUIET IMPORTED_TARGET opus)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Opus
+ REQUIRED_VARS OPUS_LINK_LIBRARIES
+ VERSION_VAR OPUS_VERSION
+)
+
+if (MSYS2)
+ FixMsysPath(PkgConfig::OPUS)
+endif()
+
+if (Opus_FOUND AND NOT TARGET Opus::opus)
+ add_library(Opus::opus ALIAS PkgConfig::OPUS)
+endif()