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/compiler/compiler.gni") | 7 import("//build/config/compiler/compiler.gni") |
8 import("//build/toolchain/ccache.gni") | 8 import("//build/toolchain/ccache.gni") |
9 | 9 |
10 if (current_cpu == "arm") { | 10 if (current_cpu == "arm") { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 | 87 |
88 # compiler --------------------------------------------------------------------- | 88 # compiler --------------------------------------------------------------------- |
89 # | 89 # |
90 # Base compiler configuration. | 90 # Base compiler configuration. |
91 # | 91 # |
92 # See also "runtime_library" below for related stuff and a discussion about | 92 # See also "runtime_library" below for related stuff and a discussion about |
93 # where stuff should go. Put warning related stuff in the "warnings" config. | 93 # where stuff should go. Put warning related stuff in the "warnings" config. |
94 | 94 |
95 config("compiler") { | 95 config("compiler") { |
96 asmflags = [] | |
97 cflags = [] | 96 cflags = [] |
98 cflags_c = [] | 97 cflags_c = [] |
99 cflags_cc = [] | 98 cflags_cc = [] |
100 cflags_objc = [] | 99 cflags_objc = [] |
101 cflags_objcc = [] | 100 cflags_objcc = [] |
102 ldflags = [] | 101 ldflags = [] |
103 defines = [] | 102 defines = [] |
104 configs = [] | 103 configs = [] |
105 | 104 |
106 # System-specific flags. If your compiler flags apply to one of the | 105 # System-specific flags. If your compiler flags apply to one of the |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 # TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu++11 | 449 # TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu++11 |
451 # or c++11; we technically don't need this toolchain any more, but there | 450 # or c++11; we technically don't need this toolchain any more, but there |
452 # are still a few buildbots using it, so until those are turned off | 451 # are still a few buildbots using it, so until those are turned off |
453 # we need the !is_nacl clause and the (is_nacl && is_clang) clause, above. | 452 # we need the !is_nacl clause and the (is_nacl && is_clang) clause, above. |
454 cflags_cc += [ "-std=c++11" ] | 453 cflags_cc += [ "-std=c++11" ] |
455 } | 454 } |
456 | 455 |
457 # Pass the same C/C++ flags to the objective C/C++ compiler. | 456 # Pass the same C/C++ flags to the objective C/C++ compiler. |
458 cflags_objc += cflags_c | 457 cflags_objc += cflags_c |
459 cflags_objcc += cflags_cc | 458 cflags_objcc += cflags_cc |
460 | |
461 # Assign any flags set for the C compiler to asmflags so that they are sent | |
462 # to the assembler. The Windows assembler takes different types of flags | |
463 # so only do so for posix platforms. | |
464 if (is_posix) { | |
465 asmflags += cflags | |
466 asmflags += cflags_c | |
467 } | |
468 } | 459 } |
469 | 460 |
470 config("compiler_arm_fpu") { | 461 config("compiler_arm_fpu") { |
471 if (current_cpu == "arm" && !is_ios && !is_nacl) { | 462 if (current_cpu == "arm" && !is_ios && !is_nacl) { |
472 cflags = [ "-mfpu=$arm_fpu" ] | 463 cflags = [ "-mfpu=$arm_fpu" ] |
473 asmflags = cflags | |
474 } | 464 } |
475 } | 465 } |
476 | 466 |
477 # runtime_library ------------------------------------------------------------- | 467 # runtime_library ------------------------------------------------------------- |
478 # | 468 # |
479 # Sets the runtime library and associated options. | 469 # Sets the runtime library and associated options. |
480 # | 470 # |
481 # How do you determine what should go in here vs. "compiler" above? Consider if | 471 # How do you determine what should go in here vs. "compiler" above? Consider if |
482 # a target might choose to use a different runtime library (ignore for a moment | 472 # a target might choose to use a different runtime library (ignore for a moment |
483 # if this is possible or reasonable on your system). If such a target would want | 473 # if this is possible or reasonable on your system). If such a target would want |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 cflags += [ | 802 cflags += [ |
813 # Don't warn about printf format problems. This is off by default in gcc | 803 # Don't warn about printf format problems. This is off by default in gcc |
814 # but on in Ubuntu's gcc(!). | 804 # but on in Ubuntu's gcc(!). |
815 "-Wno-format", | 805 "-Wno-format", |
816 ] | 806 ] |
817 cflags_cc += [ | 807 cflags_cc += [ |
818 # Don't warn about hash_map in third-party code. | 808 # Don't warn about hash_map in third-party code. |
819 "-Wno-deprecated", | 809 "-Wno-deprecated", |
820 ] | 810 ] |
821 } | 811 } |
822 | |
823 cflags += default_warning_flags | 812 cflags += default_warning_flags |
824 cflags_cc += default_warning_flags_cc | 813 cflags_cc += default_warning_flags_cc |
825 } | 814 } |
826 | 815 |
827 # rtti ------------------------------------------------------------------------ | 816 # rtti ------------------------------------------------------------------------ |
828 # | 817 # |
829 # Allows turning Run-Time Type Identification on or off. | 818 # Allows turning Run-Time Type Identification on or off. |
830 | 819 |
831 config("rtti") { | 820 config("rtti") { |
832 if (is_win) { | 821 if (is_win) { |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 # it all. This flag is incompatible with /PROFILE | 1079 # it all. This flag is incompatible with /PROFILE |
1091 ldflags = [ "/DEBUG:FASTLINK" ] | 1080 ldflags = [ "/DEBUG:FASTLINK" ] |
1092 } else { | 1081 } else { |
1093 ldflags = [ "/DEBUG" ] | 1082 ldflags = [ "/DEBUG" ] |
1094 } | 1083 } |
1095 } else { | 1084 } else { |
1096 cflags = [ "-g2" ] | 1085 cflags = [ "-g2" ] |
1097 if (use_debug_fission) { | 1086 if (use_debug_fission) { |
1098 cflags += [ "-gsplit-dwarf" ] | 1087 cflags += [ "-gsplit-dwarf" ] |
1099 } | 1088 } |
1100 asmflags = cflags | |
1101 ldflags = [] | 1089 ldflags = [] |
1102 } | 1090 } |
1103 } | 1091 } |
1104 | 1092 |
1105 # Minimal symbols. | 1093 # Minimal symbols. |
1106 config("minimal_symbols") { | 1094 config("minimal_symbols") { |
1107 if (is_win) { | 1095 if (is_win) { |
1108 # Linker symbols for backtraces only. | 1096 # Linker symbols for backtraces only. |
1109 cflags = [] | 1097 cflags = [] |
1110 if (is_win_fastlink) { | 1098 if (is_win_fastlink) { |
1111 # Tell VS 2015+ to create a PDB that references debug | 1099 # Tell VS 2015+ to create a PDB that references debug |
1112 # information in .obj and .lib files instead of copying | 1100 # information in .obj and .lib files instead of copying |
1113 # it all. This flag is incompatible with /PROFILE | 1101 # it all. This flag is incompatible with /PROFILE |
1114 ldflags = [ "/DEBUG:FASTLINK" ] | 1102 ldflags = [ "/DEBUG:FASTLINK" ] |
1115 } else { | 1103 } else { |
1116 ldflags = [ "/DEBUG" ] | 1104 ldflags = [ "/DEBUG" ] |
1117 } | 1105 } |
1118 } else { | 1106 } else { |
1119 cflags = [ "-g1" ] | 1107 cflags = [ "-g1" ] |
1120 if (use_debug_fission) { | 1108 if (use_debug_fission) { |
1121 cflags += [ "-gsplit-dwarf" ] | 1109 cflags += [ "-gsplit-dwarf" ] |
1122 } | 1110 } |
1123 asmflags = cflags | |
1124 ldflags = [] | 1111 ldflags = [] |
1125 } | 1112 } |
1126 } | 1113 } |
1127 | 1114 |
1128 # No symbols. | 1115 # No symbols. |
1129 config("no_symbols") { | 1116 config("no_symbols") { |
1130 if (!is_win) { | 1117 if (!is_win) { |
1131 cflags = [ "-g0" ] | 1118 cflags = [ "-g0" ] |
1132 asmflags = cflags | |
1133 } | 1119 } |
1134 } | 1120 } |
1135 | 1121 |
1136 # Default symbols. | 1122 # Default symbols. |
1137 config("default_symbols") { | 1123 config("default_symbols") { |
1138 if (symbol_level == 0) { | 1124 if (symbol_level == 0) { |
1139 configs = [ ":no_symbols" ] | 1125 configs = [ ":no_symbols" ] |
1140 } else if (symbol_level == 1) { | 1126 } else if (symbol_level == 1) { |
1141 configs = [ ":minimal_symbols" ] | 1127 configs = [ ":minimal_symbols" ] |
1142 } else if (symbol_level == 2) { | 1128 } else if (symbol_level == 2) { |
1143 configs = [ ":symbols" ] | 1129 configs = [ ":symbols" ] |
1144 } else { | 1130 } else { |
1145 assert(false) | 1131 assert(false) |
1146 } | 1132 } |
1147 } | 1133 } |
OLD | NEW |