Chromium Code Reviews| 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 = [] | |
| 96 cflags = [] | 97 cflags = [] |
| 97 cflags_c = [] | 98 cflags_c = [] |
| 98 cflags_cc = [] | 99 cflags_cc = [] |
| 99 cflags_objc = [] | 100 cflags_objc = [] |
| 100 cflags_objcc = [] | 101 cflags_objcc = [] |
| 101 ldflags = [] | 102 ldflags = [] |
| 102 defines = [] | 103 defines = [] |
| 103 configs = [] | 104 configs = [] |
| 104 | 105 |
| 105 # System-specific flags. If your compiler flags apply to one of the | 106 # System-specific flags. If your compiler flags apply to one of the |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 546 # TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu++11 | 547 # TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu++11 |
| 547 # or c++11; we technically don't need this toolchain any more, but there | 548 # or c++11; we technically don't need this toolchain any more, but there |
| 548 # are still a few buildbots using it, so until those are turned off | 549 # are still a few buildbots using it, so until those are turned off |
| 549 # we need the !is_nacl clause and the (is_nacl && is_clang) clause, above. | 550 # we need the !is_nacl clause and the (is_nacl && is_clang) clause, above. |
| 550 cflags_cc += [ "-std=c++11" ] | 551 cflags_cc += [ "-std=c++11" ] |
| 551 } | 552 } |
| 552 | 553 |
| 553 # Pass the same C/C++ flags to the objective C/C++ compiler. | 554 # Pass the same C/C++ flags to the objective C/C++ compiler. |
| 554 cflags_objc += cflags_c | 555 cflags_objc += cflags_c |
| 555 cflags_objcc += cflags_cc | 556 cflags_objcc += cflags_cc |
| 557 | |
| 558 if (is_posix) { | |
|
brettw
2015/09/28 19:44:52
Ditto. Also, it's probably worth mentioning that t
Bons
2015/09/28 20:15:39
Done.
| |
| 559 asmflags += cflags | |
| 560 asmflags += cflags_c | |
| 561 } | |
| 556 } | 562 } |
| 557 | 563 |
| 558 config("compiler_arm_fpu") { | 564 config("compiler_arm_fpu") { |
| 559 if (current_cpu == "arm" && !is_ios && !is_nacl) { | 565 if (current_cpu == "arm" && !is_ios && !is_nacl) { |
| 560 cflags = [ "-mfpu=$arm_fpu" ] | 566 cflags = [ "-mfpu=$arm_fpu" ] |
| 567 asmflags = cflags | |
| 561 } | 568 } |
| 562 } | 569 } |
| 563 | 570 |
| 564 # runtime_library ------------------------------------------------------------- | 571 # runtime_library ------------------------------------------------------------- |
| 565 # | 572 # |
| 566 # Sets the runtime library and associated options. | 573 # Sets the runtime library and associated options. |
| 567 # | 574 # |
| 568 # How do you determine what should go in here vs. "compiler" above? Consider if | 575 # How do you determine what should go in here vs. "compiler" above? Consider if |
| 569 # a target might choose to use a different runtime library (ignore for a moment | 576 # a target might choose to use a different runtime library (ignore for a moment |
| 570 # if this is possible or reasonable on your system). If such a target would want | 577 # 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... | |
| 899 cflags += [ | 906 cflags += [ |
| 900 # Don't warn about printf format problems. This is off by default in gcc | 907 # Don't warn about printf format problems. This is off by default in gcc |
| 901 # but on in Ubuntu's gcc(!). | 908 # but on in Ubuntu's gcc(!). |
| 902 "-Wno-format", | 909 "-Wno-format", |
| 903 ] | 910 ] |
| 904 cflags_cc += [ | 911 cflags_cc += [ |
| 905 # Don't warn about hash_map in third-party code. | 912 # Don't warn about hash_map in third-party code. |
| 906 "-Wno-deprecated", | 913 "-Wno-deprecated", |
| 907 ] | 914 ] |
| 908 } | 915 } |
| 916 | |
| 909 cflags += default_warning_flags | 917 cflags += default_warning_flags |
| 910 cflags_cc += default_warning_flags_cc | 918 cflags_cc += default_warning_flags_cc |
| 911 } | 919 } |
| 912 | 920 |
| 913 # rtti ------------------------------------------------------------------------ | 921 # rtti ------------------------------------------------------------------------ |
| 914 # | 922 # |
| 915 # Allows turning Run-Time Type Identification on or off. | 923 # Allows turning Run-Time Type Identification on or off. |
| 916 | 924 |
| 917 config("rtti") { | 925 config("rtti") { |
| 918 if (is_win) { | 926 if (is_win) { |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1176 # it all. This flag is incompatible with /PROFILE | 1184 # it all. This flag is incompatible with /PROFILE |
| 1177 ldflags = [ "/DEBUG:FASTLINK" ] | 1185 ldflags = [ "/DEBUG:FASTLINK" ] |
| 1178 } else { | 1186 } else { |
| 1179 ldflags = [ "/DEBUG" ] | 1187 ldflags = [ "/DEBUG" ] |
| 1180 } | 1188 } |
| 1181 } else { | 1189 } else { |
| 1182 cflags = [ "-g2" ] | 1190 cflags = [ "-g2" ] |
| 1183 if (use_debug_fission) { | 1191 if (use_debug_fission) { |
| 1184 cflags += [ "-gsplit-dwarf" ] | 1192 cflags += [ "-gsplit-dwarf" ] |
| 1185 } | 1193 } |
| 1194 asmflags = cflags | |
|
brettw
2015/09/28 19:44:52
I think these are OK and don't need comments since
Bons
2015/09/28 20:15:39
Acknowledged.
| |
| 1186 ldflags = [] | 1195 ldflags = [] |
| 1187 } | 1196 } |
| 1188 } | 1197 } |
| 1189 | 1198 |
| 1190 # Minimal symbols. | 1199 # Minimal symbols. |
| 1191 config("minimal_symbols") { | 1200 config("minimal_symbols") { |
| 1192 if (is_win) { | 1201 if (is_win) { |
| 1193 # Linker symbols for backtraces only. | 1202 # Linker symbols for backtraces only. |
| 1194 cflags = [] | 1203 cflags = [] |
| 1195 if (is_win_fastlink) { | 1204 if (is_win_fastlink) { |
| 1196 # Tell VS 2015+ to create a PDB that references debug | 1205 # Tell VS 2015+ to create a PDB that references debug |
| 1197 # information in .obj and .lib files instead of copying | 1206 # information in .obj and .lib files instead of copying |
| 1198 # it all. This flag is incompatible with /PROFILE | 1207 # it all. This flag is incompatible with /PROFILE |
| 1199 ldflags = [ "/DEBUG:FASTLINK" ] | 1208 ldflags = [ "/DEBUG:FASTLINK" ] |
| 1200 } else { | 1209 } else { |
| 1201 ldflags = [ "/DEBUG" ] | 1210 ldflags = [ "/DEBUG" ] |
| 1202 } | 1211 } |
| 1203 } else { | 1212 } else { |
| 1204 cflags = [ "-g1" ] | 1213 cflags = [ "-g1" ] |
| 1205 if (use_debug_fission) { | 1214 if (use_debug_fission) { |
| 1206 cflags += [ "-gsplit-dwarf" ] | 1215 cflags += [ "-gsplit-dwarf" ] |
| 1207 } | 1216 } |
| 1217 asmflags = cflags | |
| 1208 ldflags = [] | 1218 ldflags = [] |
| 1209 } | 1219 } |
| 1210 } | 1220 } |
| 1211 | 1221 |
| 1212 # No symbols. | 1222 # No symbols. |
| 1213 config("no_symbols") { | 1223 config("no_symbols") { |
| 1214 if (!is_win) { | 1224 if (!is_win) { |
| 1215 cflags = [ "-g0" ] | 1225 cflags = [ "-g0" ] |
| 1226 asmflags = cflags | |
| 1216 } | 1227 } |
| 1217 } | 1228 } |
| 1218 | 1229 |
| 1219 # Default symbols. | 1230 # Default symbols. |
| 1220 config("default_symbols") { | 1231 config("default_symbols") { |
| 1221 if (symbol_level == 0) { | 1232 if (symbol_level == 0) { |
| 1222 configs = [ ":no_symbols" ] | 1233 configs = [ ":no_symbols" ] |
| 1223 } else if (symbol_level == 1) { | 1234 } else if (symbol_level == 1) { |
| 1224 configs = [ ":minimal_symbols" ] | 1235 configs = [ ":minimal_symbols" ] |
| 1225 } else if (symbol_level == 2) { | 1236 } else if (symbol_level == 2) { |
| 1226 configs = [ ":symbols" ] | 1237 configs = [ ":symbols" ] |
| 1227 } else { | 1238 } else { |
| 1228 assert(false) | 1239 assert(false) |
| 1229 } | 1240 } |
| 1230 } | 1241 } |
| OLD | NEW |