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 if (current_cpu == "arm") { | 6 if (current_cpu == "arm") { |
7 import("//build/config/arm.gni") | 7 import("//build/config/arm.gni") |
8 } | 8 } |
9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
10 import("//build/config/mips.gni") | 10 import("//build/config/mips.gni") |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 # GCC flags, and then we handle the other non-Windows platforms specifically | 93 # GCC flags, and then we handle the other non-Windows platforms specifically |
94 # below. | 94 # below. |
95 if (is_win) { | 95 if (is_win) { |
96 # Windows compiler flags setup. | 96 # Windows compiler flags setup. |
97 # ----------------------------- | 97 # ----------------------------- |
98 cflags += [ | 98 cflags += [ |
99 "/Gy", # Enable function-level linking. | 99 "/Gy", # Enable function-level linking. |
100 "/GS", # Enable buffer security checking. | 100 "/GS", # Enable buffer security checking. |
101 "/FS", # Preserve previous PDB behavior. | 101 "/FS", # Preserve previous PDB behavior. |
102 ] | 102 ] |
103 if (is_component_build) { | |
104 cflags += [ "/EHsc" ] # Assume C functions can't throw exceptions and don
't catch | |
105 # structured exceptions (only C++ ones). | |
106 } | |
107 } else { | 103 } else { |
108 # Common GCC compiler flags setup. | 104 # Common GCC compiler flags setup. |
109 # -------------------------------- | 105 # -------------------------------- |
110 cflags += [ "-fno-strict-aliasing" ] # See http://crbug.com/32204 | 106 cflags += [ "-fno-strict-aliasing" ] # See http://crbug.com/32204 |
111 cflags_cc += [ | 107 cflags_cc += [ |
112 "-fno-threadsafe-statics", | 108 "-fno-threadsafe-statics", |
113 | 109 |
114 # Not exporting C++ inline functions can generally be applied anywhere | 110 # Not exporting C++ inline functions can generally be applied anywhere |
115 # so we do so here. Normal function visibility is controlled by | 111 # so we do so here. Normal function visibility is controlled by |
116 # //build/config/gcc:symbol_visibility_hidden. | 112 # //build/config/gcc:symbol_visibility_hidden. |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 # about things not matching, so keep exceptions on. | 523 # about things not matching, so keep exceptions on. |
528 if (is_debug) { | 524 if (is_debug) { |
529 cflags += [ "/MDd" ] | 525 cflags += [ "/MDd" ] |
530 } else { | 526 } else { |
531 cflags += [ "/MD" ] | 527 cflags += [ "/MD" ] |
532 } | 528 } |
533 } | 529 } |
534 } else { | 530 } else { |
535 # Static CRT. | 531 # Static CRT. |
536 if (is_win) { | 532 if (is_win) { |
537 # We don't use exceptions, and when we link statically we can just get | |
538 # rid of them entirely. | |
539 defines += [ "_HAS_EXCEPTIONS=0" ] | |
540 if (is_debug) { | 533 if (is_debug) { |
541 cflags += [ "/MTd" ] | 534 cflags += [ "/MTd" ] |
542 } else { | 535 } else { |
543 cflags += [ "/MT" ] | 536 cflags += [ "/MT" ] |
544 } | 537 } |
545 } | 538 } |
546 } | 539 } |
547 | 540 |
548 if (is_win) { | 541 if (is_win) { |
549 defines += [ | 542 defines += [ |
550 "__STD_C", | 543 "__STD_C", |
551 "__STDC_CONSTANT_MACROS", | |
552 "__STDC_FORMAT_MACROS", | |
553 "_CRT_RAND_S", | 544 "_CRT_RAND_S", |
554 "_CRT_SECURE_NO_DEPRECATE", | 545 "_CRT_SECURE_NO_DEPRECATE", |
| 546 "_HAS_EXCEPTIONS=0", |
555 "_SCL_SECURE_NO_DEPRECATE", | 547 "_SCL_SECURE_NO_DEPRECATE", |
556 ] | 548 ] |
557 } | 549 } |
558 | 550 |
559 # Stlport setup. Android uses a different (smaller) version of the STL. | 551 # Stlport setup. Android uses a different (smaller) version of the STL. |
560 if (is_android) { | 552 if (is_android) { |
561 if (is_clang) { | 553 if (is_clang) { |
562 # Work around incompatibilities between bionic and clang headers. | 554 # Work around incompatibilities between bionic and clang headers. |
563 defines += [ | 555 defines += [ |
564 "__compiler_offsetof=__builtin_offsetof", | 556 "__compiler_offsetof=__builtin_offsetof", |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 cflags += [ "-gsplit-dwarf" ] | 1101 cflags += [ "-gsplit-dwarf" ] |
1110 } | 1102 } |
1111 } | 1103 } |
1112 } | 1104 } |
1113 | 1105 |
1114 config("no_symbols") { | 1106 config("no_symbols") { |
1115 if (!is_win) { | 1107 if (!is_win) { |
1116 cflags = [ "-g0" ] | 1108 cflags = [ "-g0" ] |
1117 } | 1109 } |
1118 } | 1110 } |
OLD | NEW |