diff --git a/BUILD.gn b/BUILD.gn index a50aab5f4..f8a9dcc13 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -45,6 +45,7 @@ group("libyuv") { public_configs = [ ":libyuv_config" ] if (is_win && target_cpu == "x64") { + # Compile with clang in order to get inline assembly public_deps = [ ":libyuv_internal(//build/toolchain/win:clang_x64)", ] @@ -53,9 +54,20 @@ group("libyuv") { ":libyuv_internal", ] } + + if (!is_ios) { + # 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. + deps = [ + "//third_party:jpeg", + ] + } } static_library("libyuv_internal") { + visibility = [ ":*" ] + sources = [ # Headers "include/libyuv.h", @@ -122,7 +134,10 @@ static_library("libyuv_internal") { if (!is_ios) { defines += [ "HAVE_JPEG" ] - deps += [ "//third_party:jpeg" ] + + # Needed to pull in libjpeg headers. Can't add //third_party:jpeg to deps + # because in Windows x64 build it will get compiled with clang. + deps += [ "//third_party:jpeg_includes" ] } if (libyuv_use_neon) {