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

Side by Side Diff: skia/BUILD.gn

Issue 1160253011: gn: Don't build sse3 code in skia with -msse4.1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 6 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 | no next file » | 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 import("//build/config/ui.gni") 6 import("//build/config/ui.gni")
7 import("//testing/test.gni") 7 import("//testing/test.gni")
8 if (current_cpu == "arm") { 8 if (current_cpu == "arm") {
9 import("//build/config/arm.gni") 9 import("//build/config/arm.gni")
10 } 10 }
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 sources += gypi_skia_pdf.sources 550 sources += gypi_skia_pdf.sources
551 } 551 }
552 552
553 if (is_android && !is_debug) { 553 if (is_android && !is_debug) {
554 configs -= [ "//build/config/compiler:optimize" ] 554 configs -= [ "//build/config/compiler:optimize" ]
555 configs += [ "//build/config/compiler:optimize_max" ] 555 configs += [ "//build/config/compiler:optimize_max" ]
556 } 556 }
557 } 557 }
558 558
559 # Separated out so it can be compiled with different flags for SSE. 559 # Separated out so it can be compiled with different flags for SSE.
560 # TODO(GYP): This is wrong, it needs one target per arch http://crbug.com/496512 560 if (current_cpu == "x86" || current_cpu == "x64") {
561 source_set("skia_opts_sse3") {
562 sources = gypi_skia_opts.ssse3_sources
563 if (!is_win || is_clang) {
564 cflags = [ "-mssse3" ]
565 }
566 if (is_win) {
567 defines = [ "SK_CPU_SSE_LEVEL=31" ]
568 }
569 visibility = [ ":skia_opts" ]
570 configs -= [ "//build/config/compiler:chromium_code" ]
571 configs += [
572 ":skia_config",
573 ":skia_library_config",
574 "//build/config/compiler:no_chromium_code",
575 ]
576 }
577 source_set("skia_opts_sse4") {
578 sources = gypi_skia_opts.sse41_sources
579 if (!is_win || is_clang) {
580 cflags = [ "-msse4.1" ]
581 }
582 if (is_win) {
583 defines = [ "SK_CPU_SSE_LEVEL=41" ]
584 }
585 visibility = [ ":skia_opts" ]
586 configs -= [ "//build/config/compiler:chromium_code" ]
587 configs += [
588 ":skia_config",
589 ":skia_library_config",
590 "//build/config/compiler:no_chromium_code",
591 ]
592 }
593 }
561 source_set("skia_opts") { 594 source_set("skia_opts") {
562 cflags = [] 595 cflags = []
563 defines = [] 596 defines = []
564 597
598 deps = [
599 "//base",
600 ]
601
565 if (current_cpu == "x86" || current_cpu == "x64") { 602 if (current_cpu == "x86" || current_cpu == "x64") {
566 sources = gypi_skia_opts.sse2_sources + gypi_skia_opts.ssse3_sources + 603 sources = gypi_skia_opts.sse2_sources
567 gypi_skia_opts.sse41_sources 604 deps += [
568 605 ":skia_opts_sse3",
569 if (!is_win || is_clang) { 606 ":skia_opts_sse4",
570 cflags += [ "-msse4.1" ] 607 ]
571 }
572 if (is_win) {
573 defines += [ "SK_CPU_SSE_LEVEL=41" ]
574 }
575 } else if (current_cpu == "arm") { 608 } else if (current_cpu == "arm") {
576 # The assembly uses the frame pointer register (r7 in Thumb/r11 in 609 # The assembly uses the frame pointer register (r7 in Thumb/r11 in
577 # ARM), the compiler doesn't like that. 610 # ARM), the compiler doesn't like that.
578 cflags += [ "-fomit-frame-pointer" ] 611 cflags += [ "-fomit-frame-pointer" ]
579 612
580 if (arm_version >= 7) { 613 if (arm_version >= 7) {
581 sources = gypi_skia_opts.armv7_sources 614 sources = gypi_skia_opts.armv7_sources
582 if (arm_use_neon || arm_optionally_use_neon) { 615 if (arm_use_neon || arm_optionally_use_neon) {
583 sources += gypi_skia_opts.neon_sources 616 sources += gypi_skia_opts.neon_sources
584 617
(...skipping 24 matching lines...) Expand all
609 configs += [ "//build/config/compiler:optimize_max" ] 642 configs += [ "//build/config/compiler:optimize_max" ]
610 } 643 }
611 644
612 configs -= [ "//build/config/compiler:chromium_code" ] 645 configs -= [ "//build/config/compiler:chromium_code" ]
613 configs += [ 646 configs += [
614 ":skia_config", 647 ":skia_config",
615 ":skia_library_config", 648 ":skia_library_config",
616 "//build/config/compiler:no_chromium_code", 649 "//build/config/compiler:no_chromium_code",
617 ] 650 ]
618 651
619 deps = [
620 "//base",
621 ]
622
623 visibility = [ ":skia" ] 652 visibility = [ ":skia" ]
624 } 653 }
625 654
626 test("skia_unittests") { 655 test("skia_unittests") {
627 sources = [ 656 sources = [
628 "ext/analysis_canvas_unittest.cc", 657 "ext/analysis_canvas_unittest.cc",
629 "ext/bitmap_platform_device_mac_unittest.cc", 658 "ext/bitmap_platform_device_mac_unittest.cc",
630 "ext/convolver_unittest.cc", 659 "ext/convolver_unittest.cc",
631 "ext/image_operations_unittest.cc", 660 "ext/image_operations_unittest.cc",
632 "ext/pixel_ref_utils_unittest.cc", 661 "ext/pixel_ref_utils_unittest.cc",
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 "tools/filter_fuzz_stub/filter_fuzz_stub.cc", 700 "tools/filter_fuzz_stub/filter_fuzz_stub.cc",
672 ] 701 ]
673 702
674 deps = [ 703 deps = [
675 ":skia", 704 ":skia",
676 "//base", 705 "//base",
677 "//base/test:test_support", 706 "//base/test:test_support",
678 ] 707 ]
679 } 708 }
680 } 709 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698