Chromium Code Reviews| 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/allocator.gni") | 5 import("//build/config/allocator.gni") |
| 6 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
| 7 import("//build/config/chromecast_build.gni") | 7 import("//build/config/chromecast_build.gni") |
| 8 import("//build/config/crypto.gni") | 8 import("//build/config/crypto.gni") |
| 9 import("//build/config/features.gni") | 9 import("//build/config/features.gni") |
| 10 import("//build/config/sanitizers/sanitizers.gni") | 10 import("//build/config/sanitizers/sanitizers.gni") |
| 11 import("//build/config/ui.gni") | 11 import("//build/config/ui.gni") |
| 12 import("//build/toolchain/goma.gni") | 12 import("//build/toolchain/goma.gni") |
| 13 | 13 |
| 14 if (is_android) { | |
| 15 import("//build/config/android/config.gni") | |
| 16 } | |
| 17 | |
| 14 declare_args() { | 18 declare_args() { |
| 15 # When set (the default) enables C++ iterator debugging in debug builds. | 19 # When set (the default) enables C++ iterator debugging in debug builds. |
| 16 # Iterator debugging is always off in release builds (technically, this flag | 20 # Iterator debugging is always off in release builds (technically, this flag |
| 17 # affects the "debug" config, which is always available but applied by | 21 # affects the "debug" config, which is always available but applied by |
| 18 # default only in debug builds). | 22 # default only in debug builds). |
| 19 # | 23 # |
| 20 # Iterator debugging is generally useful for catching bugs. But it can | 24 # Iterator debugging is generally useful for catching bugs. But it can |
| 21 # introduce extra locking to check the state of an iterator against the state | 25 # introduce extra locking to check the state of an iterator against the state |
| 22 # of the current object. For iterator- and thread-heavy code, this can | 26 # of the current object. For iterator- and thread-heavy code, this can |
| 23 # significantly slow execution. | 27 # significantly slow execution. |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 356 "winmm.lib", | 360 "winmm.lib", |
| 357 "winspool.lib", | 361 "winspool.lib", |
| 358 "ws2_32.lib", | 362 "ws2_32.lib", |
| 359 | 363 |
| 360 # Please don't add more stuff here. We should actually be making this | 364 # Please don't add more stuff here. We should actually be making this |
| 361 # list smaller, since all common things should be covered. If you need | 365 # list smaller, since all common things should be covered. If you need |
| 362 # some extra libraries, please just add a libs = [ "foo.lib" ] to your | 366 # some extra libraries, please just add a libs = [ "foo.lib" ] to your |
| 363 # target that needs it. | 367 # target that needs it. |
| 364 ] | 368 ] |
| 365 } else if (is_android) { | 369 } else if (is_android) { |
| 366 # Android uses -nostdlib so we need to add even libc here. | 370 ldflags = [ "-nostdlib" ] |
| 367 libs = [ | 371 lib_dirs = [ "$android_libcpp_root/libs/$android_app_abi" ] |
| 368 # TODO(brettw) write a version of this, hopefully we can express this | 372 |
| 369 # without forking out to GCC just to get the library name. The android | 373 # The libc++ runtime library (must come first). |
| 370 # toolchain directory should probably be extracted into a .gni file that | 374 # ASan needs to dynamically link to libc++ even in static builds so |
| 371 # this file and the android toolchain .gn file can share. | 375 # that it can interpose operator new. |
| 372 # # Manually link the libgcc.a that the cross compiler uses. | 376 if (is_component_build || is_asan) { |
| 373 # '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)', | 377 libs = [ "c++_shared" ] |
|
brettw
2016/01/05 18:36:44
On Linux the difference between SDK and runtime li
agrieve
2016/01/06 02:09:54
Looks like libatomic is along the same lines as li
| |
| 374 "c", | 378 } else { |
| 379 libs = [ "c++_static" ] | |
| 380 } | |
| 381 | |
| 382 # libgcc must come before libdl for ld.bfd (MIPS) | |
| 383 libs += [ | |
| 384 # Manually link the libgcc.a that the cross compiler uses. This is | |
| 385 # absolute because the linker will look inside the sysroot if it's not. | |
| 386 rebase_path(android_libgcc_file), | |
| 387 "c", # Required because of -nostdlib | |
| 375 "dl", | 388 "dl", |
| 376 "m", | 389 "m", |
| 377 ] | 390 ] |
| 391 | |
| 392 # Clang with libc++ does not require an explicit atomic library reference. | |
| 393 if (!is_clang) { | |
| 394 libs += [ "atomic" ] | |
| 395 } | |
| 378 } else if (is_mac) { | 396 } else if (is_mac) { |
| 379 libs = [ | 397 libs = [ |
| 380 "AppKit.framework", | 398 "AppKit.framework", |
| 381 "ApplicationServices.framework", | 399 "ApplicationServices.framework", |
| 382 "Carbon.framework", | 400 "Carbon.framework", |
| 383 "CoreFoundation.framework", | 401 "CoreFoundation.framework", |
| 384 "Foundation.framework", | 402 "Foundation.framework", |
| 385 "IOKit.framework", | 403 "IOKit.framework", |
| 386 "OpenGL.framework", | 404 "OpenGL.framework", |
| 387 "Security.framework", | 405 "Security.framework", |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 477 # This error doesn't happen every time. In VS2013, it seems if the .pch | 495 # This error doesn't happen every time. In VS2013, it seems if the .pch |
| 478 # file doesn't exist, no error will be generated (probably MS tested this | 496 # file doesn't exist, no error will be generated (probably MS tested this |
| 479 # case but forgot the other one?). To reproduce this error, do a build, | 497 # case but forgot the other one?). To reproduce this error, do a build, |
| 480 # then delete the precompile.c.obj file, then build again. | 498 # then delete the precompile.c.obj file, then build again. |
| 481 cflags_c = [ "/wd4206" ] | 499 cflags_c = [ "/wd4206" ] |
| 482 } else if (is_mac && !is_official_build && !use_goma) { | 500 } else if (is_mac && !is_official_build && !use_goma) { |
| 483 precompiled_header = "build/precompile.h" | 501 precompiled_header = "build/precompile.h" |
| 484 precompiled_source = "//build/precompile.h" | 502 precompiled_source = "//build/precompile.h" |
| 485 } | 503 } |
| 486 } | 504 } |
| OLD | NEW |