diff options
author | agrieve <agrieve@chromium.org> | 2015-08-10 14:17:56 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-10 21:18:34 +0000 |
commit | c3cd5e6fe977af4a3c8b20ccb332896b2c888354 (patch) | |
tree | 4dccc3417f4063399d257b90cf48b1d892e100ec /build/toolchain/toolchain.gni | |
parent | a5fa5e73f767269040ba6ebf29fd42fdfe62d8ee (diff) | |
download | chromium_src-c3cd5e6fe977af4a3c8b20ccb332896b2c888354.zip chromium_src-c3cd5e6fe977af4a3c8b20ccb332896b2c888354.tar.gz chromium_src-c3cd5e6fe977af4a3c8b20ccb332896b2c888354.tar.bz2 |
GN: Use lib.unstripped rather than lib.stripped. Add a toolchain.gni
toolchain.gni introduces:
root_shlib_dir, shlib_prefix, and shlib_extension
The original goal of this change was to put shlibs under lib/ for Linux / Android, since that's where GYP puts them. However, the lack of support for loadable_module (or more specifically - per target output directory) in GN makes this infeasible at the moment.
This change also mitigates a subtle bug where on Android the unstripped .so is used mistakenly instead of the lib.stripped/ version. It also fixes shlib's link_output being set to the unstripped .so rather than the stripped .so (on Android).
BUG=509771
Review URL: https://codereview.chromium.org/1236503002
Cr-Commit-Position: refs/heads/master@{#342697}
Diffstat (limited to 'build/toolchain/toolchain.gni')
-rw-r--r-- | build/toolchain/toolchain.gni | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/build/toolchain/toolchain.gni b/build/toolchain/toolchain.gni new file mode 100644 index 0000000..5bd7d9c --- /dev/null +++ b/build/toolchain/toolchain.gni @@ -0,0 +1,40 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Toolchain-related configuration that may be needed outside the context of the +# toolchain() rules themselves. + +# Subdirectory within root_out_dir for shared library files. +# TODO(agrieve): GYP sets this to "lib" for Linux & Android, but this won't work +# in GN until support for loadable_module() is added. +# See: https://codereview.chromium.org/1236503002/ +shlib_subdir = "." + +# Root out dir for shared library files. +root_shlib_dir = root_out_dir +if (shlib_subdir != ".") { + root_shlib_dir += "/$shlib_subdir" +} + +# Extension for shared library files (including leading dot). +if (is_mac || is_ios) { + shlib_extension = ".dylib" +} else if (is_android && is_component_build) { + # By appending .cr, we prevent name collisions with libraries already + # loaded by the Android zygote. + shlib_extension = ".cr.so" +} else if (is_posix) { + shlib_extension = ".so" +} else if (is_win) { + shlib_extension = ".dll" +} else { + assert(false, "Platform not supported") +} + +# Prefix for shared library files. +if (is_posix) { + shlib_prefix = "lib" +} else { + shlib_prefix = "" +} |