| 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 # Base compiler configuration. | 5 # Base compiler configuration. |
| 6 config("compiler") { | 6 config("compiler") { |
| 7 include_dirs = [ "//" ] | 7 include_dirs = [ "//" ] |
| 8 if (is_win) { | 8 if (is_win) { |
| 9 cflags = [ | 9 cflags = [ |
| 10 "/Gy", # Enable function-level linking. | 10 "/Gy", # Enable function-level linking. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 "-fPIC", | 109 "-fPIC", |
| 110 "-pthread", | 110 "-pthread", |
| 111 "-Wl,-z,noexecstack", | 111 "-Wl,-z,noexecstack", |
| 112 "-Wl,-z,now", | 112 "-Wl,-z,now", |
| 113 "-Wl,-z,relro", | 113 "-Wl,-z,relro", |
| 114 ] | 114 ] |
| 115 } | 115 } |
| 116 | 116 |
| 117 # Clang-specific compiler flags setup. | 117 # Clang-specific compiler flags setup. |
| 118 # ------------------------------------ | 118 # ------------------------------------ |
| 119 # TODO(brettw) these should be clang-only. For now, make it mac-only since | 119 if (is_clang) { |
| 120 # that's where we always use clang. | |
| 121 if (is_mac) { # if (is_clang) { | |
| 122 cflags += [ | 120 cflags += [ |
| 123 "-fcolor-diagnostics", | 121 "-fcolor-diagnostics", |
| 124 ] | 122 ] |
| 125 } | 123 } |
| 126 } | 124 } |
| 127 } | 125 } |
| 128 | 126 |
| 129 # runtime_library ------------------------------------------------------------- | 127 # runtime_library ------------------------------------------------------------- |
| 130 # | 128 # |
| 131 # Sets the runtime library and associated options. | 129 # Sets the runtime library and associated options. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 ] | 292 ] |
| 295 | 293 |
| 296 if (is_mac) { | 294 if (is_mac) { |
| 297 cflags += [ | 295 cflags += [ |
| 298 "-Wnewline-eof", | 296 "-Wnewline-eof", |
| 299 ] | 297 ] |
| 300 } | 298 } |
| 301 | 299 |
| 302 # TODO(brettw) Ones below here should be clang-only when we have a flag | 300 # TODO(brettw) Ones below here should be clang-only when we have a flag |
| 303 # for it. | 301 # for it. |
| 304 if (is_mac) { #if (is_clang) { | 302 if (is_clang) { |
| 305 cflags += [ | 303 cflags += [ |
| 306 "-Wheader-hygiene", | 304 "-Wheader-hygiene", |
| 307 | 305 |
| 308 # This warns on using ints as initializers for floats in | 306 # This warns on using ints as initializers for floats in |
| 309 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|), | 307 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|), |
| 310 # which happens in several places in chrome code. Not sure if | 308 # which happens in several places in chrome code. Not sure if |
| 311 # this is worth fixing. | 309 # this is worth fixing. |
| 312 "-Wno-c++11-narrowing", | 310 "-Wno-c++11-narrowing", |
| 313 | 311 |
| 314 # Don't die on dtoa code that uses a char as an array index. | 312 # Don't die on dtoa code that uses a char as an array index. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 } else { | 387 } else { |
| 390 cflags = [ "-g1" ] | 388 cflags = [ "-g1" ] |
| 391 } | 389 } |
| 392 } | 390 } |
| 393 | 391 |
| 394 config("no_symbols") { | 392 config("no_symbols") { |
| 395 if (!is_win) { | 393 if (!is_win) { |
| 396 cflags = [ "-g0" ] | 394 cflags = [ "-g0" ] |
| 397 } | 395 } |
| 398 } | 396 } |
| OLD | NEW |