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

Side by Side Diff: webrtc/modules/audio_coding/BUILD.gn

Issue 1181373004: Add a [rtc_]build_with_neon variable to unify conditions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove gn config and consolidate build_with_neon condition. 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
OLDNEW
1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2 # 2 #
3 # Use of this source code is governed by a BSD-style license 3 # Use of this source code is governed by a BSD-style license
4 # that can be found in the LICENSE file in the root of the source 4 # that can be found in the LICENSE file in the root of the source
5 # tree. An additional intellectual property rights grant can be found 5 # tree. An additional intellectual property rights grant can be found
6 # in the file PATENTS. All contributing project authors may 6 # in the file PATENTS. All contributing project authors may
7 # be found in the AUTHORS file in the root of the source tree. 7 # be found in the AUTHORS file in the root of the source tree.
8 8
9 import("//build/config/arm.gni") 9 import("//build/config/arm.gni")
10 import("../../build/webrtc.gni") 10 import("../../build/webrtc.gni")
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 "codecs/isac/fix/source/entropy_coding.h", 491 "codecs/isac/fix/source/entropy_coding.h",
492 "codecs/isac/fix/source/fft.c", 492 "codecs/isac/fix/source/fft.c",
493 "codecs/isac/fix/source/fft.h", 493 "codecs/isac/fix/source/fft.h",
494 "codecs/isac/fix/source/filterbank_tables.c", 494 "codecs/isac/fix/source/filterbank_tables.c",
495 "codecs/isac/fix/source/filterbank_tables.h", 495 "codecs/isac/fix/source/filterbank_tables.h",
496 "codecs/isac/fix/source/filterbanks.c", 496 "codecs/isac/fix/source/filterbanks.c",
497 "codecs/isac/fix/source/filters.c", 497 "codecs/isac/fix/source/filters.c",
498 "codecs/isac/fix/source/initialize.c", 498 "codecs/isac/fix/source/initialize.c",
499 "codecs/isac/fix/source/isacfix.c", 499 "codecs/isac/fix/source/isacfix.c",
500 "codecs/isac/fix/source/lattice.c", 500 "codecs/isac/fix/source/lattice.c",
501 "codecs/isac/fix/source/lattice_c.c",
501 "codecs/isac/fix/source/lpc_masking_model.c", 502 "codecs/isac/fix/source/lpc_masking_model.c",
502 "codecs/isac/fix/source/lpc_masking_model.h", 503 "codecs/isac/fix/source/lpc_masking_model.h",
503 "codecs/isac/fix/source/lpc_tables.c", 504 "codecs/isac/fix/source/lpc_tables.c",
504 "codecs/isac/fix/source/lpc_tables.h", 505 "codecs/isac/fix/source/lpc_tables.h",
505 "codecs/isac/fix/source/pitch_estimator.c", 506 "codecs/isac/fix/source/pitch_estimator.c",
506 "codecs/isac/fix/source/pitch_estimator.h", 507 "codecs/isac/fix/source/pitch_estimator.h",
507 "codecs/isac/fix/source/pitch_estimator_c.c", 508 "codecs/isac/fix/source/pitch_estimator_c.c",
508 "codecs/isac/fix/source/pitch_filter.c", 509 "codecs/isac/fix/source/pitch_filter.c",
509 "codecs/isac/fix/source/pitch_filter_c.c", 510 "codecs/isac/fix/source/pitch_filter_c.c",
510 "codecs/isac/fix/source/pitch_gain_tables.c", 511 "codecs/isac/fix/source/pitch_gain_tables.c",
(...skipping 18 matching lines...) Expand all
529 "../..:common_inherited_config", 530 "../..:common_inherited_config",
530 ":isac_fix_config", 531 ":isac_fix_config",
531 ] 532 ]
532 533
533 deps = [ 534 deps = [
534 ":audio_encoder_interface", 535 ":audio_encoder_interface",
535 "../../common_audio", 536 "../../common_audio",
536 "../../system_wrappers", 537 "../../system_wrappers",
537 ] 538 ]
538 539
539 if (current_cpu == "arm64") { 540 if (rtc_build_with_neon) {
540 deps += [ ":isac_neon" ] 541 deps += [ ":isac_neon" ]
541 } 542 }
542 543
543 if (rtc_build_armv7_neon) { 544 if (current_cpu == "arm" && arm_version >= 7) {
544 deps += [ ":isac_neon" ]
545
546 # Enable compilation for the ARM v7 Neon instruction set. This is needed
547 # since //build/config/arm.gni only enables Neon for iOS, not Android.
548 # This provides the same functionality as webrtc/build/arm_neon.gypi.
549 # TODO(kjellander): Investigate if this can be moved into webrtc.gni or
550 # //build/config/arm.gni instead, to reduce code duplication.
551 # Remove the -mfpu=vfpv3-d16 cflag.
552 configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
553 cflags = [ "-mfpu=neon" ]
554
555 sources += [ 545 sources += [
556 "codecs/isac/fix/source/lattice_armv7.S", 546 "codecs/isac/fix/source/lattice_armv7.S",
557 "codecs/isac/fix/source/pitch_filter_armv6.S", 547 "codecs/isac/fix/source/pitch_filter_armv6.S",
558 ] 548 ]
559 sources -= [ "codecs/isac/fix/source/pitch_filter_c.c" ] 549 sources -= [
kjellander_webrtc 2015/06/18 09:06:23 I don't like the minus-entries for source listings
550 "codecs/isac/fix/source/lattice_c.c",
551 "codecs/isac/fix/source/pitch_filter_c.c",
552 ]
560 } 553 }
561 554
562 if (current_cpu == "mipsel") { 555 if (current_cpu == "mipsel") {
563 sources += [ 556 sources += [
564 "codecs/isac/fix/source/entropy_coding_mips.c", 557 "codecs/isac/fix/source/entropy_coding_mips.c",
565 "codecs/isac/fix/source/filters_mips.c", 558 "codecs/isac/fix/source/filters_mips.c",
566 "codecs/isac/fix/source/lattice_mips.c", 559 "codecs/isac/fix/source/lattice_mips.c",
567 "codecs/isac/fix/source/pitch_estimator_mips.c", 560 "codecs/isac/fix/source/pitch_estimator_mips.c",
568 "codecs/isac/fix/source/transform_mips.c", 561 "codecs/isac/fix/source/transform_mips.c",
569 ] 562 ]
570 sources -= [ "codecs/isac/fix/source/pitch_estimator_c.c" ] 563 sources -= [
564 "codecs/isac/fix/source/lattice_c.c",
565 "codecs/isac/fix/source/pitch_estimator_c.c",
566 ]
571 if (mips_dsp_rev > 0) { 567 if (mips_dsp_rev > 0) {
572 sources += [ "codecs/isac/fix/source/filterbanks_mips.c" ] 568 sources += [ "codecs/isac/fix/source/filterbanks_mips.c" ]
573 } 569 }
574 if (mips_dsp_rev > 1) { 570 if (mips_dsp_rev > 1) {
575 sources += [ 571 sources += [
576 "codecs/isac/fix/source/lpc_masking_model_mips.c", 572 "codecs/isac/fix/source/lpc_masking_model_mips.c",
577 "codecs/isac/fix/source/pitch_filter_mips.c", 573 "codecs/isac/fix/source/pitch_filter_mips.c",
578 ] 574 ]
579 sources -= [ "codecs/isac/fix/source/pitch_filter_c.c" ] 575 sources -= [ "codecs/isac/fix/source/pitch_filter_c.c" ]
580 } 576 }
581 } 577 }
582
583 if (!rtc_build_armv7_neon && current_cpu != "mipsel") {
584 sources += [ "codecs/isac/fix/source/lattice_c.c" ]
585 }
586 } 578 }
587 579
588 if (rtc_build_armv7_neon || current_cpu == "arm64") { 580 if (rtc_build_with_neon) {
589 source_set("isac_neon") { 581 source_set("isac_neon") {
590 sources = [ 582 sources = [
591 "codecs/isac/fix/source/entropy_coding_neon.c", 583 "codecs/isac/fix/source/entropy_coding_neon.c",
592 "codecs/isac/fix/source/filters_neon.c", 584 "codecs/isac/fix/source/filters_neon.c",
593 "codecs/isac/fix/source/lattice_neon.c", 585 "codecs/isac/fix/source/lattice_neon.c",
594 "codecs/isac/fix/source/transform_neon.c", 586 "codecs/isac/fix/source/transform_neon.c",
595 ] 587 ]
588 if (current_cpu != "arm64" || !is_clang) {
kjellander_webrtc 2015/06/18 09:06:23 This was fixed in Clang r235243 and we're currentl
zhongwei 2015/06/19 08:21:03 I've posted the patch at: https://codereview.webrt
589 # Disable AllpassFilter2FixDec16Neon function due to a clang bug.
590 # For more details refer to:
591 # https://code.google.com/p/webrtc/issues/detail?id=4567
592 sources += [ "codecs/isac/fix/source/filterbanks_neon.c" ]
593 }
596 594
597 if (rtc_build_armv7_neon) { 595 if (current_cpu != "arm64") {
598 # Enable compilation for the ARM v7 Neon instruction set. This is needed 596 # Enable compilation for the NEON instruction set. This is needed
599 # since //build/config/arm.gni only enables Neon for iOS, not Android. 597 # since //build/config/arm.gni only enables NEON for iOS, not Android.
600 # This provides the same functionality as webrtc/build/arm_neon.gypi. 598 # This provides the same functionality as webrtc/build/arm_neon.gypi.
601 # TODO(kjellander): Investigate if this can be moved into webrtc.gni or
602 # //build/config/arm.gni instead, to reduce code duplication.
603 # Remove the -mfpu=vfpv3-d16 cflag.
604 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] 599 configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
605 cflags = [ "-mfpu=neon" ] 600 cflags = [ "-mfpu=neon" ]
606 } 601 }
607 602
608 if (current_cpu != "arm64" || !is_clang) { 603 # Disable LTO due to compiler bug.
kjellander_webrtc 2015/06/18 09:06:23 Please link to the bug etc, similar to my previous
Andrew MacDonald 2015/06/25 01:09:09 Done.
609 # Disable AllpassFilter2FixDec16Neon function due to a clang bug.
610 # Refer more details at:
611 # https://code.google.com/p/webrtc/issues/detail?id=4567
612 sources += [ "codecs/isac/fix/source/filterbanks_neon.c" ]
613 }
614
615 # Disable LTO in audio_processing_neon target due to compiler bug.
616 if (rtc_use_lto) { 604 if (rtc_use_lto) {
617 cflags -= [ 605 cflags -= [
618 "-flto", 606 "-flto",
619 "-ffat-lto-objects", 607 "-ffat-lto-objects",
620 ] 608 ]
621 } 609 }
622 610
623 configs += [ "../..:common_config" ] 611 configs += [ "../..:common_config" ]
624 public_configs = [ "../..:common_inherited_config" ] 612 public_configs = [ "../..:common_inherited_config" ]
625 613
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 "../../system_wrappers", 771 "../../system_wrappers",
784 ] 772 ]
785 773
786 defines = [] 774 defines = []
787 775
788 if (rtc_include_opus) { 776 if (rtc_include_opus) {
789 defines += [ "WEBRTC_CODEC_OPUS" ] 777 defines += [ "WEBRTC_CODEC_OPUS" ]
790 deps += [ ":webrtc_opus" ] 778 deps += [ ":webrtc_opus" ]
791 } 779 }
792 } 780 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698