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

Side by Side Diff: BUILD.gn

Issue 2273823003: GN: guard tools (except fiddle) by skia_enable_tools. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SK_API is needed for these functions to live in another .so Created 4 years, 4 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 | include/core/SkImageEncoder.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 2016 Google Inc. 1 # Copyright 2016 Google Inc.
2 # 2 #
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 declare_args() { 6 declare_args() {
7 skia_enable_tools = !is_fuchsia && !is_component_build
8
7 skia_use_expat = true 9 skia_use_expat = true
8 skia_use_giflib = !is_fuchsia 10 skia_use_giflib = !is_fuchsia
9 skia_use_libjpeg_turbo = true 11 skia_use_libjpeg_turbo = true
10 skia_use_libpng = true 12 skia_use_libpng = true
11 skia_use_libwebp = !is_fuchsia 13 skia_use_libwebp = !is_fuchsia
12 skia_use_sfntly = !is_fuchsia 14 skia_use_sfntly = !is_fuchsia
13 skia_use_zlib = true 15 skia_use_zlib = true
14 } 16 }
15 17
16 skia_public_includes = [ 18 skia_public_includes = [
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 cflags = [ "-msse4.2" ] 171 cflags = [ "-msse4.2" ]
170 } 172 }
171 173
172 source_set("opts_avx") { 174 source_set("opts_avx") {
173 configs += skia_library_configs 175 configs += skia_library_configs
174 sources = opts_gypi.avx_sources 176 sources = opts_gypi.avx_sources
175 cflags = [ "-mavx" ] 177 cflags = [ "-mavx" ]
176 } 178 }
177 } 179 }
178 180
181 # Any feature of Skia that requires third-party code should be optional and use this template.
179 template("optional") { 182 template("optional") {
180 if (invoker.enabled) { 183 if (invoker.enabled) {
181 config(target_name + "_public") { 184 config(target_name + "_public") {
182 defines = invoker.public_defines 185 defines = invoker.public_defines
183 } 186 }
184 source_set(target_name) { 187 source_set(target_name) {
185 forward_variables_from(invoker, "*", [ "public_defines" ]) 188 forward_variables_from(invoker, "*", [ "public_defines" ])
186 all_dependent_configs = [ ":" + target_name + "_public" ] 189 all_dependent_configs = [ ":" + target_name + "_public" ]
187 } 190 }
188 } else { 191 } else {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 rebase_path("include/gpu/vk/GrVkBackendContext.h"), 447 rebase_path("include/gpu/vk/GrVkBackendContext.h"),
445 rebase_path("include/gpu/vk/GrVkDefines.h"), 448 rebase_path("include/gpu/vk/GrVkDefines.h"),
446 rebase_path("include/gpu/vk/GrVkInterface.h"), 449 rebase_path("include/gpu/vk/GrVkInterface.h"),
447 rebase_path("include/gpu/vk/GrVkTypes.h"), 450 rebase_path("include/gpu/vk/GrVkTypes.h"),
448 rebase_path("include/ports/SkFontMgr_fontconfig.h"), 451 rebase_path("include/ports/SkFontMgr_fontconfig.h"),
449 ] 452 ]
450 453
451 action("skia.h") { 454 action("skia.h") {
452 script = "gn/echo_headers.py" 455 script = "gn/echo_headers.py"
453 args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] + 456 args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
454 rebase_path(skia_h_headers, root_build_dir) 457 rebase_path(skia_h_headers, target_gen_dir)
455 outputs = [ 458 outputs = [
456 "$target_gen_dir/skia.h", 459 "$target_gen_dir/skia.h",
457 ] 460 ]
458 } 461 }
459 462
460 executable("fiddle") { 463 executable("fiddle") {
461 include_dirs = [ "$target_gen_dir" ] 464 include_dirs = [ "$target_gen_dir" ]
462 libs = [] 465 libs = []
463 if (is_linux) { 466 if (is_linux) {
464 libs += [ "OSMesa" ] 467 libs += [ "OSMesa" ]
465 } 468 }
466 469
467 sources = [ 470 sources = [
471 "src/images/SkForceLinking.cpp",
468 "tools/fiddle/draw.cpp", 472 "tools/fiddle/draw.cpp",
469 "tools/fiddle/fiddle_main.cpp", 473 "tools/fiddle/fiddle_main.cpp",
470 ] 474 ]
471 deps = [ 475 deps = [
472 ":skia", 476 ":skia",
473 ":skia.h", 477 ":skia.h",
474 ":tool_utils",
475 ]
476 testonly = true
477 }
478
479 template("test_lib") {
480 config(target_name + "_config") {
481 include_dirs = invoker.public_include_dirs
482 }
483 source_set(target_name) {
484 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
485 public_configs = [
486 ":" + target_name + "_config",
487 ":skia_private",
488 ]
489
490 if (!defined(deps)) {
491 deps = []
492 }
493 deps += [ ":skia" ]
494 testonly = true
495 }
496 }
497
498 test_lib("gpu_tool_utils") {
499 public_include_dirs = [ "tools/gpu" ]
500 sources = [
501 "tools/gpu/GrContextFactory.cpp",
502 "tools/gpu/GrTest.cpp",
503 "tools/gpu/TestContext.cpp",
504 "tools/gpu/gl/GLTestContext.cpp",
505 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
506 "tools/gpu/gl/debug/GrBufferObj.cpp",
507 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
508 "tools/gpu/gl/debug/GrProgramObj.cpp",
509 "tools/gpu/gl/debug/GrShaderObj.cpp",
510 "tools/gpu/gl/debug/GrTextureObj.cpp",
511 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
512 "tools/gpu/gl/null/NullGLTestContext.cpp",
513 ]
514 libs = []
515
516 if (is_linux) {
517 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
518 } else if (is_mac) {
519 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
520 }
521 }
522
523 test_lib("flags") {
524 public_include_dirs = [ "tools/flags" ]
525 sources = [
526 "tools/flags/SkCommandLineFlags.cpp",
527 "tools/flags/SkCommonFlags.cpp",
528 "tools/flags/SkCommonFlagsConfig.cpp",
529 ]
530 deps = [
531 ":gpu_tool_utils",
532 ] 478 ]
533 } 479 }
534 480
535 test_lib("tool_utils") { 481 # Targets guarded by skia_enable_tools may use //third_party freely.
536 public_include_dirs = [ 482 if (skia_enable_tools) {
537 "tools", 483 template("test_lib") {
538 "tools/debugger", 484 config(target_name + "_config") {
539 "tools/timer", 485 include_dirs = invoker.public_include_dirs
540 ] 486 }
541 sources = [ 487 source_set(target_name) {
542 "src/images/SkForceLinking.cpp", 488 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
543 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to to ols? 489 public_configs = [
544 "tools/CrashHandler.cpp", 490 ":" + target_name + "_config",
545 "tools/ProcStats.cpp", 491 ":skia_private",
546 "tools/Resources.cpp", 492 ]
547 "tools/ThermalManager.cpp", 493
548 "tools/UrlDataManager.cpp", 494 if (!defined(deps)) {
549 "tools/debugger/SkDebugCanvas.cpp", 495 deps = []
550 "tools/debugger/SkDrawCommand.cpp", 496 }
551 "tools/debugger/SkJsonWriteBuffer.cpp", 497 deps += [ ":skia" ]
552 "tools/debugger/SkObjectParser.cpp", 498 testonly = true
553 "tools/debugger/SkOverdrawMode.cpp", 499 }
554 "tools/picture_utils.cpp", 500 }
555 "tools/random_parse_path.cpp", 501
556 "tools/sk_tool_utils.cpp", 502 test_lib("gpu_tool_utils") {
557 "tools/sk_tool_utils_font.cpp", 503 public_include_dirs = [ "tools/gpu" ]
558 "tools/timer/Timer.cpp", 504 sources = [
559 ] 505 "tools/gpu/GrContextFactory.cpp",
560 deps = [ 506 "tools/gpu/GrTest.cpp",
561 ":flags", 507 "tools/gpu/TestContext.cpp",
562 "//third_party/libpng", 508 "tools/gpu/gl/GLTestContext.cpp",
563 ] 509 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
564 public_deps = [ 510 "tools/gpu/gl/debug/GrBufferObj.cpp",
565 "//third_party/jsoncpp", 511 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
566 ] 512 "tools/gpu/gl/debug/GrProgramObj.cpp",
567 } 513 "tools/gpu/gl/debug/GrShaderObj.cpp",
568 514 "tools/gpu/gl/debug/GrTextureObj.cpp",
569 gm_sources = exec_script("gyp/find.py", 515 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
570 [ 516 "tools/gpu/gl/null/NullGLTestContext.cpp",
571 "*.c*", 517 ]
572 rebase_path("gm"), 518 libs = []
573 ], 519
574 "list lines", 520 if (is_linux) {
575 []) 521 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
576 test_lib("gm") { 522 } else if (is_mac) {
577 public_include_dirs = [ "gm" ] 523 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
578 sources = gm_sources 524 }
579 deps = [ 525 }
580 ":gpu_tool_utils", 526
581 ":skia", 527 test_lib("flags") {
582 ":tool_utils", 528 public_include_dirs = [ "tools/flags" ]
583 ] 529 sources = [
584 } 530 "tools/flags/SkCommandLineFlags.cpp",
585 531 "tools/flags/SkCommonFlags.cpp",
586 tests_sources = exec_script("gyp/find.py", 532 "tools/flags/SkCommonFlagsConfig.cpp",
587 [ 533 ]
588 "*.c*", 534 deps = [
589 rebase_path("tests"), 535 ":gpu_tool_utils",
590 ], 536 ]
591 "list lines", 537 }
592 []) 538
593 539 test_lib("tool_utils") {
594 test_lib("tests") { 540 public_include_dirs = [
595 public_include_dirs = [ "tests" ] 541 "tools",
596 sources = tests_sources - [ 542 "tools/debugger",
597 rebase_path("tests/FontMgrAndroidParserTest.cpp"), # Android only 543 "tools/timer",
598 rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main 544 ]
599 rebase_path("tests/SkSLErrorTest.cpp"), # TODO: make work 545 sources = [
600 rebase_path("tests/SkSLGLSLTest.cpp"), # TODO: make work 546 "src/images/SkForceLinking.cpp",
601 rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile 547 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
602 rebase_path("tests/skia_test.cpp"), # alternate main 548 "tools/CrashHandler.cpp",
603 ] 549 "tools/ProcStats.cpp",
604 deps = [ 550 "tools/Resources.cpp",
605 ":flags", 551 "tools/ThermalManager.cpp",
606 ":gpu_tool_utils", 552 "tools/UrlDataManager.cpp",
607 ":skia", 553 "tools/debugger/SkDebugCanvas.cpp",
608 ":tool_utils", 554 "tools/debugger/SkDrawCommand.cpp",
609 "//third_party/libpng", 555 "tools/debugger/SkJsonWriteBuffer.cpp",
610 "//third_party/zlib", 556 "tools/debugger/SkObjectParser.cpp",
611 ] 557 "tools/debugger/SkOverdrawMode.cpp",
612 } 558 "tools/picture_utils.cpp",
613 559 "tools/random_parse_path.cpp",
614 bench_sources = exec_script("gyp/find.py", 560 "tools/sk_tool_utils.cpp",
615 [ 561 "tools/sk_tool_utils_font.cpp",
616 "*.c*", 562 "tools/timer/Timer.cpp",
617 rebase_path("bench"), 563 ]
618 ], 564 deps = [
619 "list lines", 565 ":flags",
620 []) 566 "//third_party/libpng",
621 567 ]
622 test_lib("bench") { 568 public_deps = [
623 public_include_dirs = [ "bench" ] 569 "//third_party/jsoncpp",
624 sources = bench_sources 570 ]
625 sources -= [ 571 }
626 rebase_path("bench/nanobench.cpp"), 572
627 rebase_path("bench/nanobenchAndroid.cpp"), 573 gm_sources = exec_script("gyp/find.py",
628 ] 574 [
629 deps = [ 575 "*.c*",
630 ":flags", 576 rebase_path("gm"),
631 ":gm", 577 ],
632 ":gpu_tool_utils", 578 "list lines",
633 ":skia", 579 [])
634 ":tool_utils", 580 test_lib("gm") {
635 ] 581 public_include_dirs = [ "gm" ]
636 } 582 sources = gm_sources
637 583 deps = [
638 test_lib("experimental_svg_model") { 584 ":gpu_tool_utils",
639 public_include_dirs = [ "experimental/svg/model" ] 585 ":skia",
640 sources = [ 586 ":tool_utils",
641 "experimental/svg/model/SkSVGAttribute.cpp", 587 ]
642 "experimental/svg/model/SkSVGAttributeParser.cpp", 588 }
643 "experimental/svg/model/SkSVGCircle.cpp", 589
644 "experimental/svg/model/SkSVGContainer.cpp", 590 tests_sources = exec_script("gyp/find.py",
645 "experimental/svg/model/SkSVGDOM.cpp", 591 [
646 "experimental/svg/model/SkSVGEllipse.cpp", 592 "*.c*",
647 "experimental/svg/model/SkSVGLine.cpp", 593 rebase_path("tests"),
648 "experimental/svg/model/SkSVGNode.cpp", 594 ],
649 "experimental/svg/model/SkSVGPath.cpp", 595 "list lines",
650 "experimental/svg/model/SkSVGPoly.cpp", 596 [])
651 "experimental/svg/model/SkSVGRect.cpp", 597
652 "experimental/svg/model/SkSVGRenderContext.cpp", 598 test_lib("tests") {
653 "experimental/svg/model/SkSVGSVG.cpp", 599 public_include_dirs = [ "tests" ]
654 "experimental/svg/model/SkSVGShape.cpp", 600 sources =
655 "experimental/svg/model/SkSVGTransformableNode.cpp", 601 tests_sources - [
656 "experimental/svg/model/SkSVGValue.cpp", 602 rebase_path("tests/FontMgrAndroidParserTest.cpp"), # Android only
657 ] 603 rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main
658 deps = [ 604 rebase_path("tests/SkSLErrorTest.cpp"), # TODO: make work
659 ":skia", 605 rebase_path("tests/SkSLGLSLTest.cpp"), # TODO: make work
660 ] 606 rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile
661 } 607 rebase_path("tests/skia_test.cpp"), # alternate main
662 608 ]
663 if (!is_component_build) { # Our test tools use many non-SK_API APIs... 609 deps = [
610 ":flags",
611 ":gpu_tool_utils",
612 ":skia",
613 ":tool_utils",
614 "//third_party/libpng",
615 "//third_party/zlib",
616 ]
617 }
618
619 bench_sources = exec_script("gyp/find.py",
620 [
621 "*.c*",
622 rebase_path("bench"),
623 ],
624 "list lines",
625 [])
626
627 test_lib("bench") {
628 public_include_dirs = [ "bench" ]
629 sources = bench_sources
630 sources -= [
631 rebase_path("bench/nanobench.cpp"),
632 rebase_path("bench/nanobenchAndroid.cpp"),
633 ]
634 deps = [
635 ":flags",
636 ":gm",
637 ":gpu_tool_utils",
638 ":skia",
639 ":tool_utils",
640 ]
641 }
642
643 test_lib("experimental_svg_model") {
644 public_include_dirs = [ "experimental/svg/model" ]
645 sources = [
646 "experimental/svg/model/SkSVGAttribute.cpp",
647 "experimental/svg/model/SkSVGAttributeParser.cpp",
648 "experimental/svg/model/SkSVGCircle.cpp",
649 "experimental/svg/model/SkSVGContainer.cpp",
650 "experimental/svg/model/SkSVGDOM.cpp",
651 "experimental/svg/model/SkSVGEllipse.cpp",
652 "experimental/svg/model/SkSVGLine.cpp",
653 "experimental/svg/model/SkSVGNode.cpp",
654 "experimental/svg/model/SkSVGPath.cpp",
655 "experimental/svg/model/SkSVGPoly.cpp",
656 "experimental/svg/model/SkSVGRect.cpp",
657 "experimental/svg/model/SkSVGRenderContext.cpp",
658 "experimental/svg/model/SkSVGSVG.cpp",
659 "experimental/svg/model/SkSVGShape.cpp",
660 "experimental/svg/model/SkSVGTransformableNode.cpp",
661 "experimental/svg/model/SkSVGValue.cpp",
662 ]
663 deps = [
664 ":skia",
665 ]
666 }
667
664 executable("dm") { 668 executable("dm") {
665 sources = [ 669 sources = [
666 "dm/DM.cpp", 670 "dm/DM.cpp",
667 "dm/DMJsonWriter.cpp", 671 "dm/DMJsonWriter.cpp",
668 "dm/DMSrcSink.cpp", 672 "dm/DMSrcSink.cpp",
669 ] 673 ]
670 include_dirs = [ "tests" ] 674 include_dirs = [ "tests" ]
671 deps = [ 675 deps = [
672 ":experimental_svg_model", 676 ":experimental_svg_model",
673 ":flags", 677 ":flags",
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 "tools/SkShaper_harfbuzz.cpp", 718 "tools/SkShaper_harfbuzz.cpp",
715 "tools/using_skia_and_harfbuzz.cpp", 719 "tools/using_skia_and_harfbuzz.cpp",
716 ] 720 ]
717 deps = [ 721 deps = [
718 ":skia", 722 ":skia",
719 "//third_party/harfbuzz", 723 "//third_party/harfbuzz",
720 ] 724 ]
721 testonly = true 725 testonly = true
722 } 726 }
723 } 727 }
OLDNEW
« no previous file with comments | « no previous file | include/core/SkImageEncoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698