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

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 1368223002: [GN]: BUILD file housecleaning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « build/config/android/BUILD.gn ('k') | build/config/mac/BUILD.gn » ('j') | 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/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
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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 # TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu++11 447 # TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu++11
447 # or c++11; we technically don't need this toolchain any more, but there 448 # or c++11; we technically don't need this toolchain any more, but there
448 # are still a few buildbots using it, so until those are turned off 449 # are still a few buildbots using it, so until those are turned off
449 # we need the !is_nacl clause and the (is_nacl && is_clang) clause, above. 450 # we need the !is_nacl clause and the (is_nacl && is_clang) clause, above.
450 cflags_cc += [ "-std=c++11" ] 451 cflags_cc += [ "-std=c++11" ]
451 } 452 }
452 453
453 # Pass the same C/C++ flags to the objective C/C++ compiler. 454 # Pass the same C/C++ flags to the objective C/C++ compiler.
454 cflags_objc += cflags_c 455 cflags_objc += cflags_c
455 cflags_objcc += cflags_cc 456 cflags_objcc += cflags_cc
457
458 # Assign any flags set for the C compiler to asmflags so that they are sent
459 # to the assembler. The Windows assembler takes different types of flags
460 # so only do so for posix platforms.
461 if (is_posix) {
462 asmflags += cflags
463 asmflags += cflags_c
464 }
456 } 465 }
457 466
458 config("compiler_arm_fpu") { 467 config("compiler_arm_fpu") {
459 if (current_cpu == "arm" && !is_ios && !is_nacl) { 468 if (current_cpu == "arm" && !is_ios && !is_nacl) {
460 cflags = [ "-mfpu=$arm_fpu" ] 469 cflags = [ "-mfpu=$arm_fpu" ]
470 asmflags = cflags
461 } 471 }
462 } 472 }
463 473
464 # runtime_library ------------------------------------------------------------- 474 # runtime_library -------------------------------------------------------------
465 # 475 #
466 # Sets the runtime library and associated options. 476 # Sets the runtime library and associated options.
467 # 477 #
468 # How do you determine what should go in here vs. "compiler" above? Consider if 478 # How do you determine what should go in here vs. "compiler" above? Consider if
469 # a target might choose to use a different runtime library (ignore for a moment 479 # a target might choose to use a different runtime library (ignore for a moment
470 # if this is possible or reasonable on your system). If such a target would want 480 # 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
799 cflags += [ 809 cflags += [
800 # Don't warn about printf format problems. This is off by default in gcc 810 # Don't warn about printf format problems. This is off by default in gcc
801 # but on in Ubuntu's gcc(!). 811 # but on in Ubuntu's gcc(!).
802 "-Wno-format", 812 "-Wno-format",
803 ] 813 ]
804 cflags_cc += [ 814 cflags_cc += [
805 # Don't warn about hash_map in third-party code. 815 # Don't warn about hash_map in third-party code.
806 "-Wno-deprecated", 816 "-Wno-deprecated",
807 ] 817 ]
808 } 818 }
819
809 cflags += default_warning_flags 820 cflags += default_warning_flags
810 cflags_cc += default_warning_flags_cc 821 cflags_cc += default_warning_flags_cc
811 } 822 }
812 823
813 # rtti ------------------------------------------------------------------------ 824 # rtti ------------------------------------------------------------------------
814 # 825 #
815 # Allows turning Run-Time Type Identification on or off. 826 # Allows turning Run-Time Type Identification on or off.
816 827
817 config("rtti") { 828 config("rtti") {
818 if (is_win) { 829 if (is_win) {
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 # it all. This flag is incompatible with /PROFILE 1087 # it all. This flag is incompatible with /PROFILE
1077 ldflags = [ "/DEBUG:FASTLINK" ] 1088 ldflags = [ "/DEBUG:FASTLINK" ]
1078 } else { 1089 } else {
1079 ldflags = [ "/DEBUG" ] 1090 ldflags = [ "/DEBUG" ]
1080 } 1091 }
1081 } else { 1092 } else {
1082 cflags = [ "-g2" ] 1093 cflags = [ "-g2" ]
1083 if (use_debug_fission) { 1094 if (use_debug_fission) {
1084 cflags += [ "-gsplit-dwarf" ] 1095 cflags += [ "-gsplit-dwarf" ]
1085 } 1096 }
1097 asmflags = cflags
1086 ldflags = [] 1098 ldflags = []
1087 } 1099 }
1088 } 1100 }
1089 1101
1090 # Minimal symbols. 1102 # Minimal symbols.
1091 config("minimal_symbols") { 1103 config("minimal_symbols") {
1092 if (is_win) { 1104 if (is_win) {
1093 # Linker symbols for backtraces only. 1105 # Linker symbols for backtraces only.
1094 cflags = [] 1106 cflags = []
1095 if (is_win_fastlink) { 1107 if (is_win_fastlink) {
1096 # Tell VS 2015+ to create a PDB that references debug 1108 # Tell VS 2015+ to create a PDB that references debug
1097 # information in .obj and .lib files instead of copying 1109 # information in .obj and .lib files instead of copying
1098 # it all. This flag is incompatible with /PROFILE 1110 # it all. This flag is incompatible with /PROFILE
1099 ldflags = [ "/DEBUG:FASTLINK" ] 1111 ldflags = [ "/DEBUG:FASTLINK" ]
1100 } else { 1112 } else {
1101 ldflags = [ "/DEBUG" ] 1113 ldflags = [ "/DEBUG" ]
1102 } 1114 }
1103 } else { 1115 } else {
1104 cflags = [ "-g1" ] 1116 cflags = [ "-g1" ]
1105 if (use_debug_fission) { 1117 if (use_debug_fission) {
1106 cflags += [ "-gsplit-dwarf" ] 1118 cflags += [ "-gsplit-dwarf" ]
1107 } 1119 }
1120 asmflags = cflags
1108 ldflags = [] 1121 ldflags = []
1109 } 1122 }
1110 } 1123 }
1111 1124
1112 # No symbols. 1125 # No symbols.
1113 config("no_symbols") { 1126 config("no_symbols") {
1114 if (!is_win) { 1127 if (!is_win) {
1115 cflags = [ "-g0" ] 1128 cflags = [ "-g0" ]
1129 asmflags = cflags
1116 } 1130 }
1117 } 1131 }
1118 1132
1119 # Default symbols. 1133 # Default symbols.
1120 config("default_symbols") { 1134 config("default_symbols") {
1121 if (symbol_level == 0) { 1135 if (symbol_level == 0) {
1122 configs = [ ":no_symbols" ] 1136 configs = [ ":no_symbols" ]
1123 } else if (symbol_level == 1) { 1137 } else if (symbol_level == 1) {
1124 configs = [ ":minimal_symbols" ] 1138 configs = [ ":minimal_symbols" ]
1125 } else if (symbol_level == 2) { 1139 } else if (symbol_level == 2) {
1126 configs = [ ":symbols" ] 1140 configs = [ ":symbols" ]
1127 } else { 1141 } else {
1128 assert(false) 1142 assert(false)
1129 } 1143 }
1130 } 1144 }
OLDNEW
« no previous file with comments | « build/config/android/BUILD.gn ('k') | build/config/mac/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698