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 += [ | |
543 "USE_STLPORT=1", | |
544 "_STLP_USE_PTR_SPECIALIZATIONS=1", | |
545 "__GNU_SOURCE=1", # Necessary for clone(). | |
546 ] | |
547 | |
548 ldflags += [ | 542 ldflags += [ |
549 "-Wl,--warn-shared-textrel", | 543 "-Wl,--warn-shared-textrel", |
550 "-nostdlib", | 544 "-nostdlib", |
551 ] | 545 ] |
552 | 546 |
553 # NOTE: The stlport header include paths below are specified in cflags | 547 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 | 548 |
561 cflags += [ "-isystem" + | 549 cflags += [ |
562 rebase_path("$android_stlport_root/stlport", root_build_dir) ] | 550 "-isystem" + |
563 lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] | 551 rebase_path("$android_libcpp_root/libcxx/include", root_build_dir), |
552 "-isystem" + rebase_path( | |
553 "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/includ e", | |
554 root_build_dir), | |
555 "-isystem" + | |
556 rebase_path("$android_ndk_root/sources/android/support/include", | |
557 root_build_dir), | |
558 ] | |
559 | |
560 lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ] | |
564 | 561 |
565 if (component_mode == "shared_library") { | 562 if (component_mode == "shared_library") { |
566 libs += [ "stlport_shared" ] | 563 android_libcpp_library = "c++_shared" |
567 } else { | 564 } else { |
568 libs += [ "stlport_static" ] | 565 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", | |
Nico
2015/02/06 17:17:19
where did this go?
Fabrice (no longer in Chrome)
2015/02/06 17:28:51
It's no longer needed. I'm the one who removed it.
| |
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 } | 566 } |
586 | 567 |
587 libs += [ | 568 libs += [ |
569 "$android_libcpp_library", | |
570 "atomic", | |
571 | |
572 # Manually link the libgcc.a that the cross compiler uses. This is | |
573 # absolute because the linker will look inside the sysroot if it's not. | |
574 rebase_path(android_libgcc_file), | |
575 "m", | |
588 "c", | 576 "c", |
589 "dl", | 577 "dl", |
590 "m", | |
591 ] | 578 ] |
592 } | 579 } |
593 } | 580 } |
594 | 581 |
595 # chromium_code --------------------------------------------------------------- | 582 # chromium_code --------------------------------------------------------------- |
596 # | 583 # |
597 # Toggles between higher and lower warnings for code that is (or isn't) | 584 # Toggles between higher and lower warnings for code that is (or isn't) |
598 # part of Chromium. | 585 # part of Chromium. |
599 | 586 |
600 config("chromium_code") { | 587 config("chromium_code") { |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1051 cflags += [ "-gsplit-dwarf" ] | 1038 cflags += [ "-gsplit-dwarf" ] |
1052 } | 1039 } |
1053 } | 1040 } |
1054 } | 1041 } |
1055 | 1042 |
1056 config("no_symbols") { | 1043 config("no_symbols") { |
1057 if (!is_win) { | 1044 if (!is_win) { |
1058 cflags = [ "-g0" ] | 1045 cflags = [ "-g0" ] |
1059 } | 1046 } |
1060 } | 1047 } |
OLD | NEW |