diff options
Diffstat (limited to 'files/BUILD.gn')
-rw-r--r-- | files/BUILD.gn | 118 |
1 files changed, 54 insertions, 64 deletions
diff --git a/files/BUILD.gn b/files/BUILD.gn index 8904fd6c..a72ff065 100644 --- a/files/BUILD.gn +++ b/files/BUILD.gn @@ -6,12 +6,12 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. -import("libyuv.gni") import("//testing/test.gni") +import("libyuv.gni") declare_args() { - # Set to false to disable building with gflags. - libyuv_use_gflags = true + # Set to false to disable building with absl flags. + libyuv_use_absl_flags = true # When building a shared library using a target in WebRTC or # Chromium projects that depends on libyuv, setting this flag @@ -27,20 +27,24 @@ config("libyuv_config") { if (is_android && current_cpu != "arm64") { ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker" ] } + + if (!libyuv_use_neon) { + defines = [ "LIBYUV_DISABLE_NEON" ] + } } # This target is built when no specific target is specified on the command line. group("default") { testonly = true - deps = [ - ":libyuv", - ] + deps = [ ":libyuv" ] if (libyuv_include_tests) { deps += [ ":compare", ":cpuid", + ":i444tonv12_eg", ":libyuv_unittest", ":psnr", + ":yuvconstants", ":yuvconvert", ] } @@ -52,13 +56,9 @@ group("libyuv") { if (is_win && target_cpu == "x64") { # Compile with clang in order to get inline assembly - public_deps = [ - ":libyuv_internal(//build/toolchain/win:win_clang_x64)", - ] + public_deps = [ ":libyuv_internal(//build/toolchain/win:win_clang_x64)" ] } else { - public_deps = [ - ":libyuv_internal", - ] + public_deps = [ ":libyuv_internal" ] } if (libyuv_use_neon) { @@ -69,11 +69,7 @@ group("libyuv") { deps += [ ":libyuv_msa" ] } - if (libyuv_use_mmi) { - deps += [ ":libyuv_mmi" ] - } - - if (!is_ios) { + if (!is_ios && !libyuv_disable_jpeg) { # Make sure that clients of libyuv link with libjpeg. This can't go in # libyuv_internal because in Windows x64 builds that will generate a clang # build of libjpeg, and we don't want two copies. @@ -102,7 +98,9 @@ static_library("libyuv_internal") { "include/libyuv/row.h", "include/libyuv/scale.h", "include/libyuv/scale_argb.h", + "include/libyuv/scale_rgb.h", "include/libyuv/scale_row.h", + "include/libyuv/scale_uv.h", "include/libyuv/version.h", "include/libyuv/video_common.h", @@ -137,6 +135,8 @@ static_library("libyuv_internal") { "source/scale_argb.cc", "source/scale_common.cc", "source/scale_gcc.cc", + "source/scale_rgb.cc", + "source/scale_uv.cc", "source/scale_win.cc", "source/video_common.cc", ] @@ -150,7 +150,7 @@ static_library("libyuv_internal") { configs += [ "//build/config/gcc:symbol_visibility_default" ] } - if (!is_ios) { + if (!is_ios && !libyuv_disable_jpeg) { defines += [ "HAVE_JPEG" ] # Needed to pull in libjpeg headers. Can't add //third_party:jpeg to deps @@ -192,9 +192,7 @@ if (libyuv_use_neon) { "source/scale_neon64.cc", ] - deps = [ - ":libyuv_internal", - ] + deps = [ ":libyuv_internal" ] public_configs = [ ":libyuv_config" ] @@ -225,27 +223,7 @@ if (libyuv_use_msa) { "source/scale_msa.cc", ] - deps = [ - ":libyuv_internal", - ] - - public_configs = [ ":libyuv_config" ] - } -} - -if (libyuv_use_mmi) { - static_library("libyuv_mmi") { - sources = [ - # MMI Source Files - "source/compare_mmi.cc", - "source/rotate_mmi.cc", - "source/row_mmi.cc", - "source/scale_mmi.cc", - ] - - deps = [ - ":libyuv_internal", - ] + deps = [ ":libyuv_internal" ] public_configs = [ ":libyuv_config" ] } @@ -275,8 +253,6 @@ if (libyuv_include_tests) { testonly = true sources = [ - # sources - # headers "unit_test/basictypes_test.cc", "unit_test/color_test.cc", "unit_test/compare_test.cc", @@ -288,7 +264,9 @@ if (libyuv_include_tests) { "unit_test/rotate_argb_test.cc", "unit_test/rotate_test.cc", "unit_test/scale_argb_test.cc", + "unit_test/scale_rgb_test.cc", "unit_test/scale_test.cc", + "unit_test/scale_uv_test.cc", "unit_test/unit_test.cc", "unit_test/unit_test.h", "unit_test/video_common_test.cc", @@ -300,19 +278,20 @@ if (libyuv_include_tests) { ] defines = [] - if (libyuv_use_gflags) { - defines += [ "LIBYUV_USE_GFLAGS" ] - deps += [ "//third_party/gflags" ] + if (libyuv_use_absl_flags) { + defines += [ "LIBYUV_USE_ABSL_FLAGS" ] + deps += [ + "//third_party/abseil-cpp/absl/flags:flag", + "//third_party/abseil-cpp/absl/flags:parse", + ] } configs += [ ":libyuv_unittest_warnings_config" ] - public_deps = [ - "//testing/gtest", - ] + public_deps = [ "//testing/gtest" ] public_configs = [ ":libyuv_unittest_config" ] - if (is_linux) { + if (is_linux || is_chromeos) { cflags = [ "-fexceptions" ] } if (is_ios) { @@ -349,10 +328,8 @@ if (libyuv_include_tests) { # sources "util/compare.cc", ] - deps = [ - ":libyuv", - ] - if (is_linux) { + deps = [ ":libyuv" ] + if (is_linux || is_chromeos) { cflags = [ "-fexceptions" ] } } @@ -362,10 +339,19 @@ if (libyuv_include_tests) { # sources "util/yuvconvert.cc", ] - deps = [ - ":libyuv", + deps = [ ":libyuv" ] + if (is_linux || is_chromeos) { + cflags = [ "-fexceptions" ] + } + } + + executable("yuvconstants") { + sources = [ + # sources + "util/yuvconstants.c", ] - if (is_linux) { + deps = [ ":libyuv" ] + if (is_linux || is_chromeos) { cflags = [ "-fexceptions" ] } } @@ -377,22 +363,26 @@ if (libyuv_include_tests) { "util/psnr_main.cc", "util/ssim.cc", ] - deps = [ - ":libyuv", - ] + deps = [ ":libyuv" ] if (!is_ios && !libyuv_disable_jpeg) { defines = [ "HAVE_JPEG" ] } } + executable("i444tonv12_eg") { + sources = [ + # sources + "util/i444tonv12_eg.cc", + ] + deps = [ ":libyuv" ] + } + executable("cpuid") { sources = [ # sources "util/cpuid.c", ] - deps = [ - ":libyuv", - ] + deps = [ ":libyuv" ] } } |