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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 defines += [ | 474 defines += [ |
475 "__STD_C", | 475 "__STD_C", |
476 "__STDC_CONSTANT_MACROS", | 476 "__STDC_CONSTANT_MACROS", |
477 "__STDC_FORMAT_MACROS", | 477 "__STDC_FORMAT_MACROS", |
478 "_CRT_RAND_S", | 478 "_CRT_RAND_S", |
479 "_CRT_SECURE_NO_DEPRECATE", | 479 "_CRT_SECURE_NO_DEPRECATE", |
480 "_SCL_SECURE_NO_DEPRECATE", | 480 "_SCL_SECURE_NO_DEPRECATE", |
481 ] | 481 ] |
482 } | 482 } |
483 | 483 |
484 # Stlport setup. Android uses a different (smaller) version of the STL. | 484 # Android setup. |
485 if (is_android) { | 485 if (is_android) { |
486 if (is_clang) { | 486 if (is_clang) { |
487 # Work around incompatibilities between bionic and clang headers. | 487 # Work around incompatibilities between bionic and clang headers. |
488 defines += [ | 488 defines += [ |
489 "__compiler_offsetof=__builtin_offsetof", | 489 "__compiler_offsetof=__builtin_offsetof", |
490 "nan=__builtin_nan", | 490 "nan=__builtin_nan", |
491 ] | 491 ] |
492 } | 492 } |
493 | 493 |
494 defines += [ | 494 defines += [ "__GNU_SOURCE=1" ] # Necessary for clone(). |
495 "USE_STLPORT=1", | |
496 "_STLP_USE_PTR_SPECIALIZATIONS=1", | |
497 "__GNU_SOURCE=1", # Necessary for clone(). | |
498 ] | |
499 | 495 |
500 ldflags += [ | 496 ldflags += [ |
501 "-Wl,--warn-shared-textrel", | 497 "-Wl,--warn-shared-textrel", |
502 "-nostdlib", | 498 "-nostdlib", |
503 ] | 499 ] |
504 | 500 |
505 # NOTE: The stlport header include paths below are specified in cflags | 501 # Libc++ setup. |
506 # rather than include_dirs because they need to come after include_dirs. | 502 android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++" |
507 # Think of them like system headers, but don't use '-isystem' because the | |
508 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit | |
509 # strange errors. The include ordering here is important; change with | |
510 # caution. | |
511 android_stlport_root = "$android_ndk_root/sources/cxx-stl/stlport" | |
512 | 503 |
513 cflags += [ "-isystem" + | 504 cflags += [ |
514 rebase_path("$android_stlport_root/stlport", root_build_dir) ] | 505 "-isystem" + |
515 lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] | 506 rebase_path("$android_libcpp_root/libcxx/include", root_build_dir), |
| 507 "-isystem" + rebase_path( |
| 508 "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/includ
e", |
| 509 root_build_dir), |
| 510 "-isystem" + |
| 511 rebase_path("$android_ndk_root/sources/android/support/include", |
| 512 root_build_dir), |
| 513 ] |
516 | 514 |
517 if (component_mode == "shared_library") { | 515 lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ] |
518 libs += [ "stlport_shared" ] | 516 libs += [ |
519 } else { | 517 "$android_libcpp_library", |
520 libs += [ "stlport_static" ] | 518 "atomic", |
521 } | |
522 | 519 |
523 if (cpu_arch == "mipsel") { | 520 # Manually link the libgcc.a that the cross compiler uses. This is |
524 libs += [ | 521 # absolute because the linker will look inside the sysroot if it's not. |
525 # ld linker is used for mips Android, and ld does not accept library | 522 rebase_path(android_libgcc_file), |
526 # absolute path prefixed by "-l"; Since libgcc does not exist in mips | 523 "m", |
527 # sysroot the proper library will be linked. | |
528 # TODO(gordanac): Remove once gold linker is used for mips Android. | |
529 "gcc", | |
530 ] | |
531 } else { | |
532 libs += [ | |
533 # Manually link the libgcc.a that the cross compiler uses. This is | |
534 # absolute because the linker will look inside the sysroot if it's not. | |
535 rebase_path(android_libgcc_file), | |
536 ] | |
537 } | |
538 | |
539 libs += [ | |
540 "c", | 524 "c", |
541 "dl", | 525 "dl", |
542 "m", | |
543 ] | 526 ] |
544 } | 527 } |
545 } | 528 } |
546 | 529 |
547 # chromium_code --------------------------------------------------------------- | 530 # chromium_code --------------------------------------------------------------- |
548 # | 531 # |
549 # Toggles between higher and lower warnings for code that is (or isn't) | 532 # Toggles between higher and lower warnings for code that is (or isn't) |
550 # part of Chromium. | 533 # part of Chromium. |
551 | 534 |
552 config("chromium_code") { | 535 config("chromium_code") { |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 cflags += [ "-gsplit-dwarf" ] | 970 cflags += [ "-gsplit-dwarf" ] |
988 } | 971 } |
989 } | 972 } |
990 } | 973 } |
991 | 974 |
992 config("no_symbols") { | 975 config("no_symbols") { |
993 if (!is_win) { | 976 if (!is_win) { |
994 cflags = [ "-g0" ] | 977 cflags = [ "-g0" ] |
995 } | 978 } |
996 } | 979 } |
OLD | NEW |