| OLD | NEW |
| 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/android/config.gni") | 5 import("//build/config/android/config.gni") |
| 6 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
| 7 import("//build/config/chromecast_build.gni") | 7 import("//build/config/chromecast_build.gni") |
| 8 import("//build/config/compiler/compiler.gni") | 8 import("//build/config/compiler/compiler.gni") |
| 9 import("//build/toolchain/cc_wrapper.gni") | 9 import("//build/toolchain/cc_wrapper.gni") |
| 10 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
| 11 import("//build_overrides/build.gni") | 11 import("//build_overrides/build.gni") |
| 12 | 12 |
| 13 if (current_cpu == "arm" || current_cpu == "arm64") { | 13 if (current_cpu == "arm" || current_cpu == "arm64") { |
| 14 import("//build/config/arm.gni") | 14 import("//build/config/arm.gni") |
| 15 } | 15 } |
| 16 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 16 if (current_cpu == "mipsel" || current_cpu == "mips64el" || |
| 17 current_cpu == "mips" || current_cpu == "mips64") { |
| 17 import("//build/config/mips.gni") | 18 import("//build/config/mips.gni") |
| 18 } | 19 } |
| 19 if (is_mac) { | 20 if (is_mac) { |
| 20 import("//build/config/mac/symbols.gni") | 21 import("//build/config/mac/symbols.gni") |
| 21 } | 22 } |
| 22 if (is_ios) { | 23 if (is_ios) { |
| 23 import("//build/config/ios/ios_sdk.gni") | 24 import("//build/config/ios/ios_sdk.gni") |
| 24 } | 25 } |
| 25 if (is_nacl) { | 26 if (is_nacl) { |
| 26 # To keep NaCl variables out of builds that don't include NaCl, all | 27 # To keep NaCl variables out of builds that don't include NaCl, all |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 } | 694 } |
| 694 } | 695 } |
| 695 | 696 |
| 696 if (mips_dsp_rev == 1) { | 697 if (mips_dsp_rev == 1) { |
| 697 cflags += [ "-mdsp" ] | 698 cflags += [ "-mdsp" ] |
| 698 } else if (mips_dsp_rev == 2) { | 699 } else if (mips_dsp_rev == 2) { |
| 699 cflags += [ "-mdspr2" ] | 700 cflags += [ "-mdspr2" ] |
| 700 } | 701 } |
| 701 | 702 |
| 702 cflags += [ "-m${mips_float_abi}-float" ] | 703 cflags += [ "-m${mips_float_abi}-float" ] |
| 704 } else if (current_cpu == "mips" && !is_nacl) { |
| 705 if (mips_arch_variant == "r6") { |
| 706 cflags += [ |
| 707 "-mips32r6", |
| 708 "-Wa,-mips32r6", |
| 709 ] |
| 710 if (mips_use_msa == true) { |
| 711 cflags += [ |
| 712 "-mmsa", |
| 713 "-mfp64", |
| 714 ] |
| 715 } |
| 716 } else if (mips_arch_variant == "r2") { |
| 717 cflags += [ |
| 718 "-mips32r2", |
| 719 "-Wa,-mips32r2", |
| 720 ] |
| 721 if (mips_float_abi == "hard" && mips_fpu_mode != "") { |
| 722 cflags += [ "-m$mips_fpu_mode" ] |
| 723 } |
| 724 } else if (mips_arch_variant == "r1") { |
| 725 cflags += [ |
| 726 "-mips32", |
| 727 "-Wa,-mips32", |
| 728 ] |
| 729 } |
| 730 |
| 731 if (mips_dsp_rev == 1) { |
| 732 cflags += [ "-mdsp" ] |
| 733 } else if (mips_dsp_rev == 2) { |
| 734 cflags += [ "-mdspr2" ] |
| 735 } |
| 736 |
| 737 cflags += [ "-m${mips_float_abi}-float" ] |
| 703 } else if (current_cpu == "mips64el") { | 738 } else if (current_cpu == "mips64el") { |
| 704 if (mips_arch_variant == "r6") { | 739 if (mips_arch_variant == "r6") { |
| 705 if (is_clang) { | 740 if (is_clang) { |
| 706 if (is_android) { | 741 if (is_android) { |
| 707 cflags += [ | 742 cflags += [ |
| 708 "--target=mips64el-linux-android", | 743 "--target=mips64el-linux-android", |
| 709 "-march=mips64el", | 744 "-march=mips64el", |
| 710 "-mcpu=mips64r6", | 745 "-mcpu=mips64r6", |
| 711 ] | 746 ] |
| 712 ldflags += [ "--target=mips64el-linux-android" ] | 747 ldflags += [ "--target=mips64el-linux-android" ] |
| (...skipping 11 matching lines...) Expand all Loading... |
| 724 "-mfp64", | 759 "-mfp64", |
| 725 ] | 760 ] |
| 726 } | 761 } |
| 727 } else if (mips_arch_variant == "r2") { | 762 } else if (mips_arch_variant == "r2") { |
| 728 cflags += [ | 763 cflags += [ |
| 729 "-mips64r2", | 764 "-mips64r2", |
| 730 "-Wa,-mips64r2", | 765 "-Wa,-mips64r2", |
| 731 ] | 766 ] |
| 732 ldflags += [ "-mips64r2" ] | 767 ldflags += [ "-mips64r2" ] |
| 733 } | 768 } |
| 769 } else if (current_cpu == "mips64") { |
| 770 if (mips_arch_variant == "r6") { |
| 771 cflags += [ |
| 772 "-mips64r6", |
| 773 "-Wa,-mips64r6", |
| 774 ] |
| 775 ldflags += [ "-mips64r6" ] |
| 776 if (mips_use_msa == true) { |
| 777 cflags += [ |
| 778 "-mmsa", |
| 779 "-mfp64", |
| 780 ] |
| 781 } |
| 782 } else if (mips_arch_variant == "r2") { |
| 783 cflags += [ |
| 784 "-mips64r2", |
| 785 "-Wa,-mips64r2", |
| 786 ] |
| 787 ldflags += [ "-mips64r2" ] |
| 788 } |
| 734 } else if (current_cpu == "pnacl" && is_nacl_nonsfi) { | 789 } else if (current_cpu == "pnacl" && is_nacl_nonsfi) { |
| 735 if (target_cpu == "x86" || target_cpu == "x64") { | 790 if (target_cpu == "x86" || target_cpu == "x64") { |
| 736 cflags += [ | 791 cflags += [ |
| 737 "-arch", | 792 "-arch", |
| 738 "x86-32-nonsfi", | 793 "x86-32-nonsfi", |
| 739 "--pnacl-bias=x86-32-nonsfi", | 794 "--pnacl-bias=x86-32-nonsfi", |
| 740 "--target=i686-unknown-nacl", | 795 "--target=i686-unknown-nacl", |
| 741 ] | 796 ] |
| 742 ldflags += [ | 797 ldflags += [ |
| 743 "-arch", | 798 "-arch", |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 # In Chromium code, we define __STDC_foo_MACROS in order to get the | 1227 # In Chromium code, we define __STDC_foo_MACROS in order to get the |
| 1173 # C99 macros on Mac and Linux. | 1228 # C99 macros on Mac and Linux. |
| 1174 defines = [ | 1229 defines = [ |
| 1175 "__STDC_CONSTANT_MACROS", | 1230 "__STDC_CONSTANT_MACROS", |
| 1176 "__STDC_FORMAT_MACROS", | 1231 "__STDC_FORMAT_MACROS", |
| 1177 ] | 1232 ] |
| 1178 | 1233 |
| 1179 if (!is_debug && !using_sanitizer && | 1234 if (!is_debug && !using_sanitizer && |
| 1180 (!is_linux || !is_clang || is_official_build) && | 1235 (!is_linux || !is_clang || is_official_build) && |
| 1181 current_cpu != "s390x" && current_cpu != "s390" && | 1236 current_cpu != "s390x" && current_cpu != "s390" && |
| 1182 current_cpu != "ppc64" && current_cpu != "ppc64") { | 1237 current_cpu != "ppc64" && current_cpu != "ppc64" && |
| 1238 current_cpu != "mips" && current_cpu != "mips64") { |
| 1183 # _FORTIFY_SOURCE isn't really supported by Clang now, see | 1239 # _FORTIFY_SOURCE isn't really supported by Clang now, see |
| 1184 # http://llvm.org/bugs/show_bug.cgi?id=16821. | 1240 # http://llvm.org/bugs/show_bug.cgi?id=16821. |
| 1185 # It seems to work fine with Ubuntu 12 headers though, so use it in | 1241 # It seems to work fine with Ubuntu 12 headers though, so use it in |
| 1186 # official builds. | 1242 # official builds. |
| 1187 # | 1243 # |
| 1188 # Non-chromium code is not guaranteed to compile cleanly with | 1244 # Non-chromium code is not guaranteed to compile cleanly with |
| 1189 # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are | 1245 # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are |
| 1190 # disabled, so only do that for Release build. | 1246 # disabled, so only do that for Release build. |
| 1191 defines += [ "_FORTIFY_SOURCE=2" ] | 1247 defines += [ "_FORTIFY_SOURCE=2" ] |
| 1192 } | 1248 } |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1764 | 1820 |
| 1765 if (is_ios || is_mac) { | 1821 if (is_ios || is_mac) { |
| 1766 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1822 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
| 1767 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1823 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
| 1768 config("enable_arc") { | 1824 config("enable_arc") { |
| 1769 common_flags = [ "-fobjc-arc" ] | 1825 common_flags = [ "-fobjc-arc" ] |
| 1770 cflags_objc = common_flags | 1826 cflags_objc = common_flags |
| 1771 cflags_objcc = common_flags | 1827 cflags_objcc = common_flags |
| 1772 } | 1828 } |
| 1773 } | 1829 } |
| OLD | NEW |