OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//testing/test.gni") | 5 import("//testing/test.gni") |
6 | 6 |
7 pdf_use_skia = false | 7 pdf_use_skia = false |
8 | 8 |
| 9 declare_args() { |
| 10 # On Android there's no system FreeType. On Windows and Mac, only a few |
| 11 # methods are used from it. |
| 12 bundle_freetype = !is_linux |
| 13 } |
| 14 |
9 config("pdfium_config") { | 15 config("pdfium_config") { |
10 cflags = [] | 16 cflags = [] |
11 include_dirs = [ | 17 include_dirs = [ "third_party/freetype/include" ] |
12 "third_party/freetype/include" | |
13 ] | |
14 defines = [ | 18 defines = [ |
15 "FT2_BUILD_LIBRARY", | |
16 "_FPDFSDK_LIB", | 19 "_FPDFSDK_LIB", |
17 "_NO_GDIPLUS_", # workaround text rendering issues on Windows | 20 "_NO_GDIPLUS_", # workaround text rendering issues on Windows |
| 21 "OPJ_STATIC", |
18 ] | 22 ] |
19 | 23 |
20 if (pdf_use_skia) { | 24 if (pdf_use_skia) { |
21 defines += [ "_SKIA_SUPPORT_" ] | 25 defines += [ "_SKIA_SUPPORT_" ] |
22 } | 26 } |
23 | 27 |
24 if (is_linux) { | 28 if (is_linux) { |
25 if (cpu_arch == "x64") { | 29 if (cpu_arch == "x64") { |
26 defines += [ "_FX_CPU_=_FX_X64_" ] | 30 defines += [ "_FX_CPU_=_FX_X64_" ] |
27 cflags += [ "-fPIC" ] | 31 cflags += [ "-fPIC" ] |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 "fpdfsdk/include/fpdf_transformpage.h", | 88 "fpdfsdk/include/fpdf_transformpage.h", |
85 "fpdfsdk/src/fpdf_transformpage.cpp", | 89 "fpdfsdk/src/fpdf_transformpage.cpp", |
86 ] | 90 ] |
87 | 91 |
88 libs = [] | 92 libs = [] |
89 configs -= [ "//build/config/compiler:chromium_code" ] | 93 configs -= [ "//build/config/compiler:chromium_code" ] |
90 configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] | 94 configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] |
91 | 95 |
92 deps = [ | 96 deps = [ |
93 "third_party:bigint", | 97 "third_party:bigint", |
94 "third_party:freetype", | |
95 "third_party:safemath", | 98 "third_party:safemath", |
96 ":fdrm", | 99 ":fdrm", |
97 ":formfiller", | 100 ":formfiller", |
98 ":fpdfapi", | 101 ":fpdfapi", |
99 ":fpdfdoc", | 102 ":fpdfdoc", |
100 ":fpdftext", | 103 ":fpdftext", |
101 ":fpdfxfa", | 104 ":fpdfxfa", |
102 ":fxcodec", | 105 ":fxcodec", |
103 ":fxcrt", | 106 ":fxcrt", |
104 ":fxedit", | 107 ":fxedit", |
105 ":fxge", | 108 ":fxge", |
106 ":javascript", | 109 ":javascript", |
107 ":jsapi", | 110 ":jsapi", |
108 ":pdfwindow", | 111 ":pdfwindow", |
109 ":xfa", | 112 ":xfa", |
110 ] | 113 ] |
111 | 114 |
112 if (is_win) { | 115 if (is_win) { |
113 libs += [ "advapi32.lib", "gdi32.lib", "user32.lib" ] | 116 libs += [ "advapi32.lib", "gdi32.lib", "user32.lib" ] |
114 } | 117 } |
115 | 118 |
116 if (is_mac) { | 119 if (is_mac) { |
117 libs += [ "AppKit.framework", "CoreFoundation.framework" ] | 120 libs += [ "AppKit.framework", "CoreFoundation.framework" ] |
118 } | 121 } |
| 122 |
| 123 if (bundle_freetype) { |
| 124 deps += [ "third_party:freetype" ] |
| 125 } else { |
| 126 libs += [ "freetype" ] |
| 127 } |
119 } | 128 } |
120 | 129 |
121 # Targets below this are only visible within this file. | 130 # Targets below this are only visible within this file. |
122 visibility = [ ":*" ] | 131 visibility = [ ":*" ] |
123 | 132 |
124 static_library("fdrm") { | 133 static_library("fdrm") { |
125 sources = [ | 134 sources = [ |
126 "core/include/fdrm/fx_crypt.h", | 135 "core/include/fdrm/fx_crypt.h", |
127 "core/src/fdrm/crypto/fx_crypt.cpp", | 136 "core/src/fdrm/crypto/fx_crypt.cpp", |
128 "core/src/fdrm/crypto/fx_crypt_aes.cpp", | 137 "core/src/fdrm/crypto/fx_crypt_aes.cpp", |
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1573 "testing/fx_string_testhelpers.h", | 1582 "testing/fx_string_testhelpers.h", |
1574 ] | 1583 ] |
1575 deps = [ | 1584 deps = [ |
1576 "//testing/gtest", | 1585 "//testing/gtest", |
1577 ":pdfium" | 1586 ":pdfium" |
1578 ] | 1587 ] |
1579 include_dirs = [ "." ] | 1588 include_dirs = [ "." ] |
1580 configs -= [ "//build/config/compiler:chromium_code" ] | 1589 configs -= [ "//build/config/compiler:chromium_code" ] |
1581 configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] | 1590 configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] |
1582 } | 1591 } |
OLD | NEW |