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

Side by Side Diff: skia/BUILD.gn

Issue 231983002: Add support for substring replacement in gypi_to_gn (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « build/gypi_to_gn.py ('k') | skia/skia_gn_files.gypi » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 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("//build/config/features.gni") 5 import("//build/config/features.gni")
6 if (cpu_arch == "arm") { 6 if (cpu_arch == "arm") {
7 import("//build/config/arm.gni") 7 import("//build/config/arm.gni")
8 } 8 }
9 9
10 skia_support_gpu = !is_ios 10 skia_support_gpu = !is_ios
11 skia_support_pdf = !is_ios && enable_printing != 0 11 skia_support_pdf = !is_ios && enable_printing != 0
12 12
13 # The list of Skia files is kept in skia_gn_files.gypi. Read it. 13 # The list of Skia files is kept in skia_gn_files.gypi. Read it.
14 gypi_values = exec_script("//build/gypi_to_gn.py", 14 gypi_values = exec_script(
15 [ rebase_path("skia_gn_files.gypi") ], 15 "//build/gypi_to_gn.py",
16 "scope", 16 [ rebase_path("skia_gn_files.gypi"),
17 [ "skia_gn_files.gypi" ]) 17 "--replace=<(skia_include_path)=//third_party/skia/include",
18 18 "--replace=<(skia_src_path)=//third_party/skia/src" ]
19 # This files in the skia gypi file are relative to this directory. 19 "scope",
20 skia_dir = "//third_party/skia" 20 [ "skia_gn_files.gypi" ])
21
22 # Same as skia_dir but relative to the current directory. This is what all
23 # files will be prefixed to once we rebase them to be relative to our file. If
24 # you need to filter out a file, prefix it with $skia_rel_dir.
25 skia_rel_dir = rebase_path(".", ".", skia_dir)
26 21
27 # External-facing config for dependent code. 22 # External-facing config for dependent code.
28 config("skia_config") { 23 config("skia_config") {
29 include_dirs = [ 24 include_dirs = [
30 "config", 25 "config",
31 "ext", 26 "ext",
32 "//third_party/skia/include/config", 27 "//third_party/skia/include/config",
33 "//third_party/skia/include/core", 28 "//third_party/skia/include/core",
34 "//third_party/skia/include/effects", 29 "//third_party/skia/include/effects",
35 "//third_party/skia/include/images", 30 "//third_party/skia/include/images",
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 "ext/skia_utils_win.cc", 209 "ext/skia_utils_win.cc",
215 "ext/skia_utils_win.h", 210 "ext/skia_utils_win.h",
216 "ext/vector_canvas.h", 211 "ext/vector_canvas.h",
217 "ext/vector_platform_device_emf_win.cc", 212 "ext/vector_platform_device_emf_win.cc",
218 "ext/vector_platform_device_emf_win.h", 213 "ext/vector_platform_device_emf_win.h",
219 "ext/vector_platform_device_skia.cc", 214 "ext/vector_platform_device_skia.cc",
220 "ext/vector_platform_device_skia.h", 215 "ext/vector_platform_device_skia.h",
221 ] 216 ]
222 217
223 # The skia gypi values are relative to the skia_dir, so we need to rebase. 218 # The skia gypi values are relative to the skia_dir, so we need to rebase.
224 sources += rebase_path(gypi_values.skia_core_sources, ".", skia_dir) 219 sources += gypi_values.skia_core_sources
225 sources += rebase_path(gypi_values.skia_effects_sources, ".", skia_dir) 220 sources += gypi_values.skia_effects_sources
226 sources += rebase_path(gypi_values.skia_pdf_sources, ".", skia_dir) 221 sources += gypi_values.skia_pdf_sources
227 sources += rebase_path(gypi_values.skia_library_sources, ".", skia_dir) 222 sources += gypi_values.skia_library_sources
228 223
229 # GPU 224 # GPU
230 if (skia_support_gpu) { 225 if (skia_support_gpu) {
231 sources += rebase_path(gypi_values.skia_gpu_sources, ".", skia_dir) 226 sources += gypi_values.skia_gpu_sources
232 } 227 }
233 228
234 # Fixup Chrome sources. 229 # Fixup Chrome sources.
235 if (is_posix) { 230 if (is_posix) {
236 sources -= [ "ext/SkThread_chrome.cc" ] 231 sources -= [ "ext/SkThread_chrome.cc" ]
237 } 232 }
238 if (is_ios) { 233 if (is_ios) {
239 sources -= [ "ext/vector_platform_device_skia.cc" ] 234 sources -= [ "ext/vector_platform_device_skia.cc" ]
240 } 235 }
241 if (is_win) { 236 if (is_win) {
242 sources -= [ "ext/SkThread_chrome.cc" ] 237 sources -= [ "ext/SkThread_chrome.cc" ]
243 } 238 }
244 if (is_android && enable_printing == 0) { 239 if (is_android && enable_printing == 0) {
245 sources -= [ 240 sources -= [
246 "ext/skia_utils_base.cc", 241 "ext/skia_utils_base.cc",
247 "ext/vector_platform_device_skia.cc" 242 "ext/vector_platform_device_skia.cc"
248 ] 243 ]
249 } 244 }
250 245
251 # Fixup skia library sources. 246 # Fixup skia library sources.
252 if (is_win) { 247 if (is_win) {
253 sources -= [ 248 sources -= [
254 "$skia_rel_dir/src/ports/SkOSFile_posix.cpp", 249 "//third_party/skia/src/ports/SkOSFile_posix.cpp",
255 "$skia_rel_dir/src/ports/SkTime_Unix.cpp", 250 "//third_party/skia/src/ports/SkTime_Unix.cpp",
256 "$skia_rel_dir/src/ports/SkTLS_pthread.cpp", 251 "//third_party/skia/src/ports/SkTLS_pthread.cpp",
257 "$skia_rel_dir/src/ports/SkFontConfigInterface_direct.cpp", 252 "//third_party/skia/src/ports/SkFontConfigInterface_direct.cpp",
258 "$skia_rel_dir/src/fonts/SkFontMgr_fontconfig.cpp", 253 "//third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp",
259 ] 254 ]
260 } else { 255 } else {
261 sources -= [ 256 sources -= [
262 "$skia_rel_dir/src/ports/SkFontHost_win.cpp", 257 "//third_party/skia/src/ports/SkFontHost_win.cpp",
263 "$skia_rel_dir/src/ports/SkFontHost_win_dw.cpp", 258 "//third_party/skia/src/ports/SkFontHost_win_dw.cpp",
264 "$skia_rel_dir/src/ports/SkFontMgr_default_gdi.cpp", 259 "//third_party/skia/src/ports/SkFontMgr_default_gdi.cpp",
265 "$skia_rel_dir/src/ports/SkOSFile_win.cpp", 260 "//third_party/skia/src/ports/SkOSFile_win.cpp",
266 "$skia_rel_dir/src/ports/SkThread_win.cpp", 261 "//third_party/skia/src/ports/SkThread_win.cpp",
267 "$skia_rel_dir/src/ports/SkTLS_win.cpp", 262 "//third_party/skia/src/ports/SkTLS_win.cpp",
268 "$skia_rel_dir/src/utils/SkThreadUtils_win.cpp", 263 "//third_party/skia/src/utils/SkThreadUtils_win.cpp",
269 ] 264 ]
270 } 265 }
271 if (!is_android) { 266 if (!is_android) {
272 sources -= [ 267 sources -= [
273 "$skia_rel_dir/src/ports/SkFontConfigInterface_android.cpp", 268 "//third_party/skia/src/ports/SkFontConfigInterface_android.cpp",
274 "$skia_rel_dir/src/ports/SkFontConfigParser_android.cpp", 269 "//third_party/skia/src/ports/SkFontConfigParser_android.cpp",
275 ] 270 ]
276 } 271 }
277 if (!is_mac) { 272 if (!is_mac) {
278 sources -= [ 273 sources -= [
279 "$skia_rel_dir/src/ports/SkFontHost_mac.cpp", 274 "//third_party/skia/src/ports/SkFontHost_mac.cpp",
280 "$skia_rel_dir/src/utils/SkThreadUtils_pthread_mach.cpp", 275 "//third_party/skia/src/utils/SkThreadUtils_pthread_mach.cpp",
281 ] 276 ]
282 } 277 }
283 if (!is_linux) { 278 if (!is_linux) {
284 sources -= [ 279 sources -= [
285 "$skia_rel_dir/src/ports/SkFontHost_FreeType.cpp", 280 "//third_party/skia/src/ports/SkFontHost_FreeType.cpp",
286 "$skia_rel_dir/src/ports/SkFontHost_FreeType_common.cpp", 281 "//third_party/skia/src/ports/SkFontHost_FreeType_common.cpp",
287 "$skia_rel_dir/src/ports/SkFontHost_fontconfig.cpp", 282 "//third_party/skia/src/ports/SkFontHost_fontconfig.cpp",
288 "$skia_rel_dir/src/ports/SkFontHost_linux.cpp", 283 "//third_party/skia/src/ports/SkFontHost_linux.cpp",
289 ] 284 ]
290 } else if (!is_android) { 285 } else if (!is_android) {
291 sources -= [ 286 sources -= [
292 "$skia_rel_dir/src/ports/SkFontConfigInterface_direct.cpp", 287 "//third_party/skia/src/ports/SkFontConfigInterface_direct.cpp",
293 "$skia_rel_dir/src/fonts/SkFontMgr_fontconfig.cpp", 288 "//third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp",
294 ] 289 ]
295 } 290 }
296 291
297 configs -= [ "//build/config/compiler:chromium_code" ] 292 configs -= [ "//build/config/compiler:chromium_code" ]
298 configs += [ 293 configs += [
299 ":skia_library_config", 294 ":skia_library_config",
300 "//build/config/compiler:no_chromium_code" 295 "//build/config/compiler:no_chromium_code"
301 ] 296 ]
302 direct_dependent_configs = [ ":skia_config" ] 297 direct_dependent_configs = [ ":skia_config" ]
303 298
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 354
360 configs -= [ "//build/config/compiler:chromium_code" ] 355 configs -= [ "//build/config/compiler:chromium_code" ]
361 configs += [ 356 configs += [
362 ":skia_config", 357 ":skia_config",
363 "//build/config/compiler:no_chromium_code" 358 "//build/config/compiler:no_chromium_code"
364 ] 359 ]
365 360
366 # TODO(brettw) uncomment when visibility is supported. 361 # TODO(brettw) uncomment when visibility is supported.
367 #visibility = ":skia" 362 #visibility = ":skia"
368 } 363 }
OLDNEW
« no previous file with comments | « build/gypi_to_gn.py ('k') | skia/skia_gn_files.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698