Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: BUILD.gn

Issue 826613004: Use system FreeType (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: update GN files Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | core/include/fxge/fx_freetype.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 = [
12 "third_party/freetype/include"
13 ]
14 defines = [ 17 defines = [
15 "FT2_BUILD_LIBRARY",
16 "_FPDFSDK_LIB", 18 "_FPDFSDK_LIB",
17 "_NO_GDIPLUS_", # workaround text rendering issues on Windows 19 "_NO_GDIPLUS_", # workaround text rendering issues on Windows
18 "OPJ_STATIC", 20 "OPJ_STATIC",
19 ] 21 ]
20 22
21 if (pdf_use_skia) { 23 if (pdf_use_skia) {
22 defines += [ "_SKIA_SUPPORT_" ] 24 defines += [ "_SKIA_SUPPORT_" ]
23 } 25 }
24 26
25 if (is_linux) { 27 if (is_linux) {
26 if (cpu_arch == "x64") { 28 if (cpu_arch == "x64") {
27 defines += [ "_FX_CPU_=_FX_X64_" ] 29 defines += [ "_FX_CPU_=_FX_X64_" ]
28 cflags += [ "-fPIC" ] 30 cflags += [ "-fPIC" ]
29 } else if (cpu_arch == "x86") { 31 } else if (cpu_arch == "x86") {
30 defines += [ "_FX_CPU_=_FX_X86_" ] 32 defines += [ "_FX_CPU_=_FX_X86_" ]
31 } 33 }
32 } 34 }
33 35
34 if (is_win) { 36 if (is_win) {
35 cflags += [ 37 cflags += [
36 "/wd4005", 38 "/wd4005",
37 "/wd4018", 39 "/wd4018",
38 "/wd4146", 40 "/wd4146",
39 "/wd4333", 41 "/wd4333",
40 "/wd4345", 42 "/wd4345",
41 ] 43 ]
42 } 44 }
45
46 if (bundle_freetype) {
47 include_dirs = [ "third_party/freetype/include" ]
48 defines += [ "FT2_BUILD_LIBRARY" ]
49 } else {
50 include_dirs = [ "/usr/include/freetype2" ]
51 }
43 } 52 }
44 53
45 static_library("pdfium") { 54 static_library("pdfium") {
46 sources = [ 55 sources = [
47 "fpdfsdk/include/fpdfdoc.h", 56 "fpdfsdk/include/fpdfdoc.h",
48 "fpdfsdk/include/fpdfedit.h", 57 "fpdfsdk/include/fpdfedit.h",
49 "fpdfsdk/include/fpdfformfill.h", 58 "fpdfsdk/include/fpdfformfill.h",
50 "fpdfsdk/include/fpdftext.h", 59 "fpdfsdk/include/fpdftext.h",
51 "fpdfsdk/include/fpdfview.h", 60 "fpdfsdk/include/fpdfview.h",
52 "fpdfsdk/include/fpdf_dataavail.h", 61 "fpdfsdk/include/fpdf_dataavail.h",
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 "fpdfsdk/include/fpdf_transformpage.h", 94 "fpdfsdk/include/fpdf_transformpage.h",
86 "fpdfsdk/src/fpdf_transformpage.cpp", 95 "fpdfsdk/src/fpdf_transformpage.cpp",
87 ] 96 ]
88 97
89 libs = [] 98 libs = []
90 configs -= [ "//build/config/compiler:chromium_code" ] 99 configs -= [ "//build/config/compiler:chromium_code" ]
91 configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] 100 configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ]
92 101
93 deps = [ 102 deps = [
94 "third_party:bigint", 103 "third_party:bigint",
95 "third_party:freetype",
96 "third_party:safemath", 104 "third_party:safemath",
97 ":fdrm", 105 ":fdrm",
98 ":formfiller", 106 ":formfiller",
99 ":fpdfapi", 107 ":fpdfapi",
100 ":fpdfdoc", 108 ":fpdfdoc",
101 ":fpdftext", 109 ":fpdftext",
102 ":fxcodec", 110 ":fxcodec",
103 ":fxcrt", 111 ":fxcrt",
104 ":fxedit", 112 ":fxedit",
105 ":fxge", 113 ":fxge",
106 ":javascript", 114 ":javascript",
107 ":jsapi", 115 ":jsapi",
108 ":pdfwindow", 116 ":pdfwindow",
109 ] 117 ]
110 118
111 if (is_win) { 119 if (is_win) {
112 libs += [ "advapi32.lib", "gdi32.lib", "user32.lib" ] 120 libs += [ "advapi32.lib", "gdi32.lib", "user32.lib" ]
113 } 121 }
114 122
115 if (is_mac) { 123 if (is_mac) {
116 libs += [ "AppKit.framework", "CoreFoundation.framework" ] 124 libs += [ "AppKit.framework", "CoreFoundation.framework" ]
117 } 125 }
126
127 if (bundle_freetype) {
128 deps += [ "third_party:freetype" ]
129 } else {
130 libs += [ "freetype" ]
131 }
118 } 132 }
119 133
120 # Targets below this are only visible within this file. 134 # Targets below this are only visible within this file.
121 visibility = [ ":*" ] 135 visibility = [ ":*" ]
122 136
123 static_library("fdrm") { 137 static_library("fdrm") {
124 sources = [ 138 sources = [
125 "core/include/fdrm/fx_crypt.h", 139 "core/include/fdrm/fx_crypt.h",
126 "core/src/fdrm/crypto/fx_crypt.cpp", 140 "core/src/fdrm/crypto/fx_crypt.cpp",
127 "core/src/fdrm/crypto/fx_crypt_aes.cpp", 141 "core/src/fdrm/crypto/fx_crypt_aes.cpp",
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 "testing/fx_string_testhelpers.h", 836 "testing/fx_string_testhelpers.h",
823 ] 837 ]
824 deps = [ 838 deps = [
825 "//testing/gtest", 839 "//testing/gtest",
826 ":pdfium" 840 ":pdfium"
827 ] 841 ]
828 include_dirs = [ "." ] 842 include_dirs = [ "." ]
829 configs -= [ "//build/config/compiler:chromium_code" ] 843 configs -= [ "//build/config/compiler:chromium_code" ]
830 configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ] 844 configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ]
831 } 845 }
OLDNEW
« no previous file with comments | « no previous file | core/include/fxge/fx_freetype.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698