diff options
Diffstat (limited to 'chromium/third_party/openh264/BUILD.gn')
-rw-r--r-- | chromium/third_party/openh264/BUILD.gn | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/chromium/third_party/openh264/BUILD.gn b/chromium/third_party/openh264/BUILD.gn index 7b9d4588b80..e33b5233b5b 100644 --- a/chromium/third_party/openh264/BUILD.gn +++ b/chromium/third_party/openh264/BUILD.gn @@ -2,7 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/linux/pkg_config.gni") import("//build/config/sanitizers/sanitizers.gni") +import("//build/shim_headers.gni") import("//third_party/openh264/openh264_args.gni") import("//third_party/openh264/openh264_sources.gni") import("//third_party/yasm/yasm_assemble.gni") @@ -101,7 +103,7 @@ if (use_assembler) { } } # if (is_win || is_linux) -source_set("common") { +source_set("bundled_common") { sources = openh264_common_sources include_dirs = openh264_common_include_dirs @@ -124,7 +126,7 @@ source_set("common") { } } -source_set("processing") { +source_set("bundled_processing") { sources = openh264_processing_sources include_dirs = openh264_processing_include_dirs @@ -132,7 +134,7 @@ source_set("processing") { configs += [ "//build/config/compiler:no_chromium_code" ] configs += [ ":config" ] deps = [ - ":common", + ":bundled_common", ] if (use_assembler) { defines = [ "X86_ASM" ] @@ -140,7 +142,7 @@ source_set("processing") { } } -source_set("encoder") { +source_set("bundled_encoder") { sources = openh264_encoder_sources include_dirs = openh264_encoder_include_dirs @@ -154,11 +156,55 @@ source_set("encoder") { configs -= [ "//build/config/clang:extra_warnings" ] } deps = [ - ":common", - ":processing", + ":bundled_common", + ":bundled_processing", ] if (use_assembler) { defines = [ "X86_ASM" ] deps += [ ":openh264_encoder_yasm" ] } } + +if (use_system_openh264) { + pkg_config("system_openh264") { + packages = [ "openh264" ] + } +} + +shim_headers("openh264_shim") { + prefix = "wels/" + root_path = "src/codec/api/svc" + headers = [ + "codec_api.h", + "codec_app_def.h", + "codec_def.h", + "codec_ver.h", + ] +} + +group("common") { + if (use_system_openh264) { + deps = [ ":openh264_shim" ] + public_configs = [ ":system_openh264" ] + } else { + public_deps = [ ":bundled_common" ] + } +} + +group("processing") { + if (use_system_openh264) { + deps = [ ":openh264_shim" ] + public_configs = [ ":system_openh264" ] + } else { + public_deps = [ ":bundled_processing" ] + } +} + +group("encoder") { + if (use_system_openh264) { + deps = [ ":openh264_shim" ] + public_configs = [ ":system_openh264" ] + } else { + public_deps = [ ":bundled_encoder" ] + } +} |