diff options
Diffstat (limited to 'chromium/third_party/opus/BUILD.gn')
-rw-r--r-- | chromium/third_party/opus/BUILD.gn | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/chromium/third_party/opus/BUILD.gn b/chromium/third_party/opus/BUILD.gn index 2394f5cd469..c266a4aa36b 100644 --- a/chromium/third_party/opus/BUILD.gn +++ b/chromium/third_party/opus/BUILD.gn @@ -3,8 +3,14 @@ # found in the LICENSE file. import("//build/config/arm.gni") +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") import("//testing/test.gni") +declare_args() { + use_system_opus = false +} + # If fixed point implementation shall be used (otherwise float). use_opus_fixed_point = current_cpu == "arm" || current_cpu == "arm64" @@ -207,7 +213,7 @@ if (use_opus_x86_optimization) { # Note: Do not add any defines or include_dirs to this target, those should all # go in the opus_private_config so they can be shared with intrinsic targets. -static_library("opus") { +static_library("bundled_opus") { sources = [ "src/celt/_kiss_fft_guts.h", "src/celt/arch.h", @@ -627,3 +633,29 @@ if (is_android || is_linux || is_chromeos) { ] } } + +if (use_system_opus) { + pkg_config("system_opus") { + packages = [ "opus" ] + } +} + +shim_headers("opus_shim") { + root_path = "src/include" + headers = [ + "opus.h", + "opus_custom.h", + "opus_defines.h", + "opus_multistream.h", + "opus_types.h", + ] +} + +group("opus") { + if (use_system_opus) { + deps = [ ":opus_shim" ] + public_configs = [ ":system_opus" ] + } else { + public_deps = [ ":bundled_opus" ] + } +} |