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 (cpu_arch == "mipsel" || cpu_arch == "mips64el") { | 9 if (cpu_arch == "mipsel" || cpu_arch == "mips64el") { |
10 import("//build/config/mips.gni") | 10 import("//build/config/mips.gni") |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 defines += [ | 522 defines += [ |
523 "__STD_C", | 523 "__STD_C", |
524 "__STDC_CONSTANT_MACROS", | 524 "__STDC_CONSTANT_MACROS", |
525 "__STDC_FORMAT_MACROS", | 525 "__STDC_FORMAT_MACROS", |
526 "_CRT_RAND_S", | 526 "_CRT_RAND_S", |
527 "_CRT_SECURE_NO_DEPRECATE", | 527 "_CRT_SECURE_NO_DEPRECATE", |
528 "_SCL_SECURE_NO_DEPRECATE", | 528 "_SCL_SECURE_NO_DEPRECATE", |
529 ] | 529 ] |
530 } | 530 } |
531 | 531 |
532 # Stlport setup. Android uses a different (smaller) version of the STL. | 532 # Android standard library setup. |
533 if (is_android) { | 533 if (is_android) { |
534 if (is_clang) { | 534 if (is_clang) { |
535 # Work around incompatibilities between bionic and clang headers. | 535 # Work around incompatibilities between bionic and clang headers. |
536 defines += [ | 536 defines += [ |
537 "__compiler_offsetof=__builtin_offsetof", | 537 "__compiler_offsetof=__builtin_offsetof", |
538 "nan=__builtin_nan", | 538 "nan=__builtin_nan", |
539 ] | 539 ] |
540 } | 540 } |
541 | 541 |
542 defines += [ | 542 defines += [ "__GNU_SOURCE=1" ] # Necessary for clone(). |
543 "USE_STLPORT=1", | |
544 "_STLP_USE_PTR_SPECIALIZATIONS=1", | |
545 "__GNU_SOURCE=1", # Necessary for clone(). | |
546 ] | |
547 | 543 |
548 ldflags += [ | 544 ldflags += [ |
549 "-Wl,--warn-shared-textrel", | 545 "-Wl,--warn-shared-textrel", |
550 "-nostdlib", | 546 "-nostdlib", |
551 ] | 547 ] |
552 | 548 |
553 # NOTE: The stlport header include paths below are specified in cflags | 549 android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++" |
554 # rather than include_dirs because they need to come after include_dirs. | |
555 # Think of them like system headers, but don't use '-isystem' because the | |
556 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit | |
557 # strange errors. The include ordering here is important; change with | |
558 # caution. | |
559 android_stlport_root = "$android_ndk_root/sources/cxx-stl/stlport" | |
560 | 550 |
561 cflags += [ "-isystem" + | 551 cflags += [ |
562 rebase_path("$android_stlport_root/stlport", root_build_dir) ] | 552 "-isystem" + |
563 lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] | 553 rebase_path("$android_libcpp_root/libcxx/include", root_build_dir), |
| 554 "-isystem" + rebase_path( |
| 555 "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/includ
e", |
| 556 root_build_dir), |
| 557 "-isystem" + |
| 558 rebase_path("$android_ndk_root/sources/android/support/include", |
| 559 root_build_dir), |
| 560 ] |
| 561 |
| 562 lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ] |
564 | 563 |
565 if (component_mode == "shared_library") { | 564 if (component_mode == "shared_library") { |
566 libs += [ "stlport_shared" ] | 565 android_libcpp_library = "c++_shared" |
567 } else { | 566 } else { |
568 libs += [ "stlport_static" ] | 567 android_libcpp_library = "c++_static" |
569 } | |
570 | |
571 if (cpu_arch == "mipsel") { | |
572 libs += [ | |
573 # ld linker is used for mips Android, and ld does not accept library | |
574 # absolute path prefixed by "-l"; Since libgcc does not exist in mips | |
575 # sysroot the proper library will be linked. | |
576 # TODO(gordanac): Remove once gold linker is used for mips Android. | |
577 "gcc", | |
578 ] | |
579 } else { | |
580 libs += [ | |
581 # Manually link the libgcc.a that the cross compiler uses. This is | |
582 # absolute because the linker will look inside the sysroot if it's not. | |
583 rebase_path(android_libgcc_file), | |
584 ] | |
585 } | 568 } |
586 | 569 |
587 libs += [ | 570 libs += [ |
| 571 "$android_libcpp_library", |
| 572 "atomic", |
| 573 |
| 574 # Manually link the libgcc.a that the cross compiler uses. This is |
| 575 # absolute because the linker will look inside the sysroot if it's not. |
| 576 rebase_path(android_libgcc_file), |
| 577 "m", |
588 "c", | 578 "c", |
589 "dl", | 579 "dl", |
590 "m", | |
591 ] | 580 ] |
592 } | 581 } |
593 } | 582 } |
594 | 583 |
595 # chromium_code --------------------------------------------------------------- | 584 # chromium_code --------------------------------------------------------------- |
596 # | 585 # |
597 # Toggles between higher and lower warnings for code that is (or isn't) | 586 # Toggles between higher and lower warnings for code that is (or isn't) |
598 # part of Chromium. | 587 # part of Chromium. |
599 | 588 |
600 config("chromium_code") { | 589 config("chromium_code") { |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 cflags += [ "-gsplit-dwarf" ] | 1040 cflags += [ "-gsplit-dwarf" ] |
1052 } | 1041 } |
1053 } | 1042 } |
1054 } | 1043 } |
1055 | 1044 |
1056 config("no_symbols") { | 1045 config("no_symbols") { |
1057 if (!is_win) { | 1046 if (!is_win) { |
1058 cflags = [ "-g0" ] | 1047 cflags = [ "-g0" ] |
1059 } | 1048 } |
1060 } | 1049 } |
OLD | NEW |