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 (cpu_arch == "arm") { | 6 if (cpu_arch == "arm") { |
7 import("//build/config/arm.gni") | 7 import("//build/config/arm.gni") |
8 } | 8 } |
9 if (is_posix) { | 9 if (is_posix) { |
10 import("//build/config/gcc/gcc_version.gni") | 10 import("//build/config/gcc/gcc_version.gni") |
(...skipping 28 matching lines...) Expand all Loading... |
39 # source root and might have conflicting versions of some headers) can remove | 39 # source root and might have conflicting versions of some headers) can remove |
40 # this and specify their own include paths. | 40 # this and specify their own include paths. |
41 config("default_include_dirs") { | 41 config("default_include_dirs") { |
42 include_dirs = [ | 42 include_dirs = [ |
43 "//", | 43 "//", |
44 root_gen_dir, | 44 root_gen_dir, |
45 ] | 45 ] |
46 } | 46 } |
47 | 47 |
48 # TODO(GYP): is_ubsan, is_ubsan_vptr | 48 # TODO(GYP): is_ubsan, is_ubsan_vptr |
49 using_sanitizer = is_asan || is_lsan || is_tsan || is_msan | 49 if (!is_win) { |
| 50 using_sanitizer = is_asan || is_lsan || is_tsan || is_msan |
| 51 } |
50 | 52 |
51 # compiler --------------------------------------------------------------------- | 53 # compiler --------------------------------------------------------------------- |
52 # | 54 # |
53 # Base compiler configuration. | 55 # Base compiler configuration. |
54 # | 56 # |
55 # See also "runtime_library" below for related stuff and a discusison about | 57 # See also "runtime_library" below for related stuff and a discusison about |
56 # where stuff should go. Put warning related stuff in the "warnings" config. | 58 # where stuff should go. Put warning related stuff in the "warnings" config. |
57 | 59 |
58 config("compiler") { | 60 config("compiler") { |
59 cflags = [] | 61 cflags = [] |
(...skipping 13 matching lines...) Expand all Loading... |
73 "/Gy", # Enable function-level linking. | 75 "/Gy", # Enable function-level linking. |
74 "/GS", # Enable buffer security checking. | 76 "/GS", # Enable buffer security checking. |
75 "/FS", # Preserve previous PDB behavior. | 77 "/FS", # Preserve previous PDB behavior. |
76 ] | 78 ] |
77 if (is_component_build) { | 79 if (is_component_build) { |
78 cflags += [ | 80 cflags += [ |
79 "/EHsc", # Assume C functions can't throw exceptions and don't catch | 81 "/EHsc", # Assume C functions can't throw exceptions and don't catch |
80 # structured exceptions (only C++ ones). | 82 # structured exceptions (only C++ ones). |
81 ] | 83 ] |
82 } | 84 } |
83 if (using_sanitizer) { | |
84 # Avoid error. | |
85 } | |
86 } else { | 85 } else { |
87 # Common GCC compiler flags setup. | 86 # Common GCC compiler flags setup. |
88 # -------------------------------- | 87 # -------------------------------- |
89 cflags += [ | 88 cflags += [ |
90 "-fno-strict-aliasing", # See http://crbug.com/32204 | 89 "-fno-strict-aliasing", # See http://crbug.com/32204 |
91 ] | 90 ] |
92 cflags_cc += [ | 91 cflags_cc += [ |
93 "-fno-threadsafe-statics", | 92 "-fno-threadsafe-statics", |
94 # Not exporting C++ inline functions can generally be applied anywhere | 93 # Not exporting C++ inline functions can generally be applied anywhere |
95 # so we do so here. Normal function visibility is controlled by | 94 # so we do so here. Normal function visibility is controlled by |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 # Think of them like system headers, but don't use '-isystem' because the | 478 # Think of them like system headers, but don't use '-isystem' because the |
480 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit | 479 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit |
481 # strange errors. The include ordering here is important; change with | 480 # strange errors. The include ordering here is important; change with |
482 # caution. | 481 # caution. |
483 android_stlport_root = "$android_ndk_root/sources/cxx-stl/stlport" | 482 android_stlport_root = "$android_ndk_root/sources/cxx-stl/stlport" |
484 | 483 |
485 cflags += [ | 484 cflags += [ |
486 "-isystem" + rebase_path("$android_stlport_root/stlport", | 485 "-isystem" + rebase_path("$android_stlport_root/stlport", |
487 root_build_dir) | 486 root_build_dir) |
488 ] | 487 ] |
489 lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] | 488 if (arm_use_thumb) { |
| 489 lib_dirs += [ "$android_stlport_root/libs/$android_app_abi/thumb" ] |
| 490 } else { |
| 491 lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] |
| 492 } |
490 | 493 |
491 if (component_mode == "shared_library") { | 494 if (component_mode == "shared_library") { |
492 libs += [ "stlport_shared" ] | 495 libs += [ "stlport_shared" ] |
493 } else { | 496 } else { |
494 libs += [ "stlport_static" ] | 497 libs += [ "stlport_static" ] |
495 } | 498 } |
496 | 499 |
497 if (cpu_arch == "mipsel") { | 500 if (cpu_arch == "mipsel") { |
498 libs += [ | 501 libs += [ |
499 # ld linker is used for mips Android, and ld does not accept library | 502 # ld linker is used for mips Android, and ld does not accept library |
(...skipping 21 matching lines...) Expand all Loading... |
521 | 524 |
522 # chromium_code --------------------------------------------------------------- | 525 # chromium_code --------------------------------------------------------------- |
523 # | 526 # |
524 # Toggles between higher and lower warnings for code that is (or isn't) | 527 # Toggles between higher and lower warnings for code that is (or isn't) |
525 # part of Chromium. | 528 # part of Chromium. |
526 | 529 |
527 config("chromium_code") { | 530 config("chromium_code") { |
528 if (is_win) { | 531 if (is_win) { |
529 cflags = [ | 532 cflags = [ |
530 "/W4", # Warning level 4. | 533 "/W4", # Warning level 4. |
531 "/wd4267", # TODO(jschuh): crbug.com/167187 size_t to int truncations. | |
532 ] | 534 ] |
533 } else { | 535 } else { |
534 cflags = [ | 536 cflags = [ |
535 "-Wall", | 537 "-Wall", |
536 "-Wextra", | |
537 | 538 |
538 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't, | 539 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't, |
539 # so we specify it explicitly. | 540 # so we specify it explicitly. |
540 # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it. | 541 # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it. |
541 # http://code.google.com/p/chromium/issues/detail?id=90453 | 542 # http://code.google.com/p/chromium/issues/detail?id=90453 |
542 "-Wsign-compare", | 543 "-Wsign-compare", |
543 ] | 544 ] |
544 | 545 |
545 # In Chromium code, we define __STDC_foo_MACROS in order to get the | 546 # In Chromium code, we define __STDC_foo_MACROS in order to get the |
546 # C99 macros on Mac and Linux. | 547 # C99 macros on Mac and Linux. |
547 defines = [ | 548 defines = [ |
548 "__STDC_CONSTANT_MACROS", | 549 "__STDC_CONSTANT_MACROS", |
549 "__STDC_FORMAT_MACROS", | 550 "__STDC_FORMAT_MACROS", |
550 ] | 551 ] |
551 } | 552 } |
552 } | 553 } |
553 config("no_chromium_code") { | 554 config("no_chromium_code") { |
554 cflags = [] | 555 cflags = [] |
555 cflags_cc = [] | 556 cflags_cc = [] |
556 defines = [] | 557 defines = [] |
557 | 558 |
558 if (is_win) { | 559 if (is_win) { |
559 cflags += [ | 560 cflags += [ |
560 "/W3", # Warning level 3. | 561 "/W3", # Warning level 3. |
561 "/wd4800", # Disable warning when forcing value to bool. | 562 "/wd4800", # Disable warning when forcing value to bool. |
562 "/wd4267", # TODO(jschuh): crbug.com/167187 size_t to int truncations. | |
563 ] | 563 ] |
564 defines += [ | 564 defines += [ |
565 "_CRT_NONSTDC_NO_WARNINGS", | 565 "_CRT_NONSTDC_NO_WARNINGS", |
566 "_CRT_NONSTDC_NO_DEPRECATE", | 566 "_CRT_NONSTDC_NO_DEPRECATE", |
567 ] | 567 ] |
568 } | 568 } |
569 | 569 |
570 if (is_linux) { | 570 if (is_linux) { |
571 # Don't warn about ignoring the return value from e.g. close(). This is | 571 # Don't warn about ignoring the return value from e.g. close(). This is |
572 # off by default in some gccs but on by default in others. BSD systems do | 572 # off by default in some gccs but on by default in others. BSD systems do |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 cflags += [ "-gsplit-dwarf" ] | 957 cflags += [ "-gsplit-dwarf" ] |
958 } | 958 } |
959 } | 959 } |
960 } | 960 } |
961 | 961 |
962 config("no_symbols") { | 962 config("no_symbols") { |
963 if (!is_win) { | 963 if (!is_win) { |
964 cflags = [ "-g0" ] | 964 cflags = [ "-g0" ] |
965 } | 965 } |
966 } | 966 } |
OLD | NEW |