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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
445 defines += [ | 445 defines += [ |
446 "__STD_C", | 446 "__STD_C", |
447 "__STDC_CONSTANT_MACROS", | 447 "__STDC_CONSTANT_MACROS", |
448 "__STDC_FORMAT_MACROS", | 448 "__STDC_FORMAT_MACROS", |
449 "_CRT_RAND_S", | 449 "_CRT_RAND_S", |
450 "_CRT_SECURE_NO_DEPRECATE", | 450 "_CRT_SECURE_NO_DEPRECATE", |
451 "_SCL_SECURE_NO_DEPRECATE", | 451 "_SCL_SECURE_NO_DEPRECATE", |
452 ] | 452 ] |
453 } | 453 } |
454 | 454 |
455 # Stlport setup. Android uses a different (smaller) version of the STL. | 455 # Android setup. |
456 if (is_android) { | 456 if (is_android) { |
457 if (is_clang) { | 457 if (is_clang) { |
458 # Work around incompatibilities between bionic and clang headers. | 458 # Work around incompatibilities between bionic and clang headers. |
459 defines += [ | 459 defines += [ |
460 "__compiler_offsetof=__builtin_offsetof", | 460 "__compiler_offsetof=__builtin_offsetof", |
461 "nan=__builtin_nan", | 461 "nan=__builtin_nan", |
462 ] | 462 ] |
463 } | 463 } |
464 | 464 |
465 defines += [ | 465 defines += [ "__GNU_SOURCE=1" ] # Necessary for clone(). |
466 "USE_STLPORT=1", | |
467 "_STLP_USE_PTR_SPECIALIZATIONS=1", | |
468 "__GNU_SOURCE=1", # Necessary for clone(). | |
469 ] | |
470 | 466 |
471 ldflags += [ | 467 ldflags += [ |
472 "-Wl,--warn-shared-textrel", | 468 "-Wl,--warn-shared-textrel", |
473 "-nostdlib", | 469 "-nostdlib", |
474 ] | 470 ] |
475 | 471 |
476 # NOTE: The stlport header include paths below are specified in cflags | 472 # Libc++ setup. |
477 # rather than include_dirs because they need to come after include_dirs. | 473 android_libcpp_root = "$android_ndk_root/sources/cxx-stl/llvm-libc++" |
478 # Think of them like system headers, but don't use '-isystem' because the | |
479 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit | |
480 # strange errors. The include ordering here is important; change with | |
481 # caution. | |
482 android_stlport_root = "$android_ndk_root/sources/cxx-stl/stlport" | |
483 | 474 |
475 cflags_cc = [ "-std=gnu++11" ] | |
Nico
2014/11/05 17:30:10
Same question as in the gyp file
Fabrice (no longer in Chrome)
2014/11/12 11:52:29
Done.
| |
484 cflags += [ | 476 cflags += [ |
485 "-isystem" + rebase_path("$android_stlport_root/stlport", | 477 "-isystem" + rebase_path("$android_libcpp_root/libcxx/include", |
486 root_build_dir) | 478 root_build_dir), |
479 "-isystem" + rebase_path("$android_ndk_root/sources/cxx-stl/llvm-libc++abi /libcxxabi/include", | |
480 root_build_dir), | |
481 "-isystem" + rebase_path("$android_ndk_root/sources/android/support/includ e", | |
482 root_build_dir), | |
487 ] | 483 ] |
488 lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] | |
489 | 484 |
490 if (component_mode == "shared_library") { | 485 lib_dirs += [ "$android_libcpp_root/libs/$android_app_abi" ] |
491 libs += [ "stlport_shared" ] | |
492 } else { | |
493 libs += [ "stlport_static" ] | |
494 } | |
495 | |
496 if (cpu_arch == "mipsel") { | |
497 libs += [ | |
498 # ld linker is used for mips Android, and ld does not accept library | |
499 # absolute path prefixed by "-l"; Since libgcc does not exist in mips | |
500 # sysroot the proper library will be linked. | |
501 # TODO(gordanac): Remove once gold linker is used for mips Android. | |
502 "gcc", | |
503 ] | |
504 } else { | |
505 libs += [ | |
506 # Manually link the libgcc.a that the cross compiler uses. This is | |
507 # absolute because the linker will look inside the sysroot if it's not. | |
508 rebase_path(android_libgcc_file), | |
509 ] | |
510 } | |
511 | |
512 libs += [ | 486 libs += [ |
487 "$android_libcpp_library", | |
488 "atomic", | |
489 # Manually link the libgcc.a that the cross compiler uses. This is | |
490 # absolute because the linker will look inside the sysroot if it's not. | |
491 rebase_path(android_libgcc_file), | |
492 "m", | |
513 "c", | 493 "c", |
514 "dl", | 494 "dl", |
515 "m", | |
516 ] | 495 ] |
517 | 496 |
518 } | 497 } |
519 } | 498 } |
520 | 499 |
521 # chromium_code --------------------------------------------------------------- | 500 # chromium_code --------------------------------------------------------------- |
522 # | 501 # |
523 # Toggles between higher and lower warnings for code that is (or isn't) | 502 # Toggles between higher and lower warnings for code that is (or isn't) |
524 # part of Chromium. | 503 # part of Chromium. |
525 | 504 |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
953 cflags += [ "-gsplit-dwarf" ] | 932 cflags += [ "-gsplit-dwarf" ] |
954 } | 933 } |
955 } | 934 } |
956 } | 935 } |
957 | 936 |
958 config("no_symbols") { | 937 config("no_symbols") { |
959 if (!is_win) { | 938 if (!is_win) { |
960 cflags = [ "-g0" ] | 939 cflags = [ "-g0" ] |
961 } | 940 } |
962 } | 941 } |
OLD | NEW |