summaryrefslogtreecommitdiff
path: root/third_party/BUILD.gn
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-04-06 21:43:50 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-07 04:54:45 +0000
commit0e5d892fe86d7c2527d8f7b7ac2c5aa8fc77a7be (patch)
treed47e7f2c57e4c2231efb6ed197d695c3537859dd /third_party/BUILD.gn
parent4bb4029b1523aa1dbd328fee6ac66385c5fa5b48 (diff)
downloadpdfium-0e5d892fe86d7c2527d8f7b7ac2c5aa8fc77a7be.tar.xz
Use libjpeg-turbo instead of our own copy of libjpeg.
Check out libjpeg-turbo via DEPS. Also checkout yasm via DEPS and copy some yasm build files from Chromium. BUG=chromium:541704,pdfium:389 Change-Id: Ic7af415f002a3ca2acd9223ed3474dedf3930b32 Reviewed-on: https://pdfium-review.googlesource.com/3470 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'third_party/BUILD.gn')
-rw-r--r--third_party/BUILD.gn107
1 files changed, 33 insertions, 74 deletions
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
index 81f919046f..c270a1063a 100644
--- a/third_party/BUILD.gn
+++ b/third_party/BUILD.gn
@@ -280,83 +280,42 @@ static_library("fx_lcms2") {
]
}
-# This is only used for standalone builds.
-config("jpeg_warnings") {
- visibility = [ ":*" ]
- if (is_clang) {
- cflags = [ "-Wno-shift-negative-value" ]
+if (!build_with_chromium) {
+ declare_args() {
+ # Uses system libjpeg. If true, overrides use_libjpeg_turbo.
+ use_system_libjpeg = false
+
+ # Uses libjpeg_turbo as the jpeg implementation. Has no effect if
+ # use_system_libjpeg is set.
+ use_libjpeg_turbo = true
}
-}
-static_library("jpeg") {
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- "//build/config/compiler:no_chromium_code",
- ":pdfium_third_party_config",
+ config("system_libjpeg_config") {
+ libs = [ "jpeg" ]
+ defines = [ "USE_SYSTEM_LIBJPEG" ]
+ }
- # Must be after no_chromium_code for warning flags to be ordered correctly.
- ":jpeg_warnings",
- ]
- sources = [
- "libjpeg/cderror.h",
- "libjpeg/cdjpeg.h",
- "libjpeg/fpdfapi_jcapimin.c",
- "libjpeg/fpdfapi_jcapistd.c",
- "libjpeg/fpdfapi_jccoefct.c",
- "libjpeg/fpdfapi_jccolor.c",
- "libjpeg/fpdfapi_jcdctmgr.c",
- "libjpeg/fpdfapi_jchuff.c",
- "libjpeg/fpdfapi_jcinit.c",
- "libjpeg/fpdfapi_jcmainct.c",
- "libjpeg/fpdfapi_jcmarker.c",
- "libjpeg/fpdfapi_jcmaster.c",
- "libjpeg/fpdfapi_jcomapi.c",
- "libjpeg/fpdfapi_jcparam.c",
- "libjpeg/fpdfapi_jcphuff.c",
- "libjpeg/fpdfapi_jcprepct.c",
- "libjpeg/fpdfapi_jcsample.c",
- "libjpeg/fpdfapi_jctrans.c",
- "libjpeg/fpdfapi_jdapimin.c",
- "libjpeg/fpdfapi_jdapistd.c",
- "libjpeg/fpdfapi_jdcoefct.c",
- "libjpeg/fpdfapi_jdcolor.c",
- "libjpeg/fpdfapi_jddctmgr.c",
- "libjpeg/fpdfapi_jdhuff.c",
- "libjpeg/fpdfapi_jdinput.c",
- "libjpeg/fpdfapi_jdmainct.c",
- "libjpeg/fpdfapi_jdmarker.c",
- "libjpeg/fpdfapi_jdmaster.c",
- "libjpeg/fpdfapi_jdmerge.c",
- "libjpeg/fpdfapi_jdphuff.c",
- "libjpeg/fpdfapi_jdpostct.c",
- "libjpeg/fpdfapi_jdsample.c",
- "libjpeg/fpdfapi_jdtrans.c",
- "libjpeg/fpdfapi_jerror.c",
- "libjpeg/fpdfapi_jfdctfst.c",
- "libjpeg/fpdfapi_jfdctint.c",
- "libjpeg/fpdfapi_jidctfst.c",
- "libjpeg/fpdfapi_jidctint.c",
- "libjpeg/fpdfapi_jidctred.c",
- "libjpeg/fpdfapi_jmemmgr.c",
- "libjpeg/fpdfapi_jmemnobs.c",
- "libjpeg/fpdfapi_jutils.c",
- "libjpeg/jchuff.h",
- "libjpeg/jconfig.h",
- "libjpeg/jdct.h",
- "libjpeg/jdhuff.h",
- "libjpeg/jerror.h",
- "libjpeg/jinclude.h",
- "libjpeg/jmemsys.h",
- "libjpeg/jmorecfg.h",
- "libjpeg/jpegint.h",
- "libjpeg/jpeglib.h",
- "libjpeg/jversion.h",
- "libjpeg/makefile",
- "libjpeg/transupp.h",
- ]
- deps = [
- "..:fxcrt",
- ]
+ config("libjpeg_turbo_config") {
+ defines = [ "USE_LIBJPEG_TURBO=1" ]
+ }
+
+ # This is a meta target that forwards to the system's libjpeg,
+ # third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args
+ # declared in this file.
+ group("jpeg") {
+ if (use_system_libjpeg) {
+ public_configs = [ ":system_libjpeg_config" ]
+ } else if (use_libjpeg_turbo) {
+ public_deps = [
+ "//third_party/libjpeg_turbo:libjpeg",
+ ]
+ public_configs = [ ":libjpeg_turbo_config" ]
+ } else {
+ public_deps = [
+ "//third_party/libjpeg:libjpeg",
+ ]
+ }
+ }
}
config("fx_libopenjpeg_warnings") {