chromium-src-build/config/sysroot.gni

65 строки
2.3 KiB
Plaintext
Исходник Обычный вид История

# Copyright (c) 2013 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.
# This header file defines the "sysroot" variable which is the absolute path
# of the sysroot. If no sysroot applies, the variable will be an empty string.
declare_args() {
# The absolute path of the sysroot that is applied when compiling using
# the target toolchain.
target_sysroot = ""
}
if (current_toolchain == default_toolchain && target_sysroot != "") {
sysroot = target_sysroot
} else if (is_android) {
import("//build/config/android/config.gni")
if (!is_android_webview_build) {
if (current_cpu == "x86") {
Make GN Android build link executables. Some minor tweaks in STL usage in GN itself to enable it to compile using the Android version of the STL. Enable this in the build (not so much because we need a GN binary on Android, but for build verification purposes). Moved the executable_ldconfig config from the linux file to the gcc one since its shared between the Linux and Android builds. Added "-Bdynamic" and "-Wl,-z,nocopyreloc" to this on Android. Moved some sysroot path components from sysroot.gni to android/config.gni (which sysroot uses) so it can be shared with the toolchain definitions. Added the android_full_debug build flag. Made the "optimize off" mode of the build match the GYP build's "light optimization" on Android contingent on this flag. Pulls out the optimize and optimize_max shared flags into one list to avoid duplication. Adds a bunch of linker optimization flags that should be passed on non-Mac Posix platforms, and turns on dead code stripping for Mac builds. Adds functionality to the gcc toolchain template to be able to insert strings before and after the libs. Adds a wrapper template for android toolchains that sets these accordingly to get the gross Android crtbegin/end files inserted in the right place on the linker line. Made the android_ndk_root variable relative to the source root rather than the system root. Uses of this now rebase according to their own needs which makes some of the arguments a lot easier to follow. Build file updates for base and libevent for Android. Implement ashmem library. The only change on desktop linux is the addition of -Wl,--fatal-warnings to the linker line. R=ajwong@chromium.org, cjhopman@chromium.org, scottmg@chromium.org Review URL: https://codereview.chromium.org/275703003 git-svn-id: http://src.chromium.org/svn/trunk/src/build@270138 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-05-13 21:41:06 +04:00
sysroot = rebase_path("$android_ndk_root/$x86_android_sysroot_subdir")
} else if (current_cpu == "arm") {
Make GN Android build link executables. Some minor tweaks in STL usage in GN itself to enable it to compile using the Android version of the STL. Enable this in the build (not so much because we need a GN binary on Android, but for build verification purposes). Moved the executable_ldconfig config from the linux file to the gcc one since its shared between the Linux and Android builds. Added "-Bdynamic" and "-Wl,-z,nocopyreloc" to this on Android. Moved some sysroot path components from sysroot.gni to android/config.gni (which sysroot uses) so it can be shared with the toolchain definitions. Added the android_full_debug build flag. Made the "optimize off" mode of the build match the GYP build's "light optimization" on Android contingent on this flag. Pulls out the optimize and optimize_max shared flags into one list to avoid duplication. Adds a bunch of linker optimization flags that should be passed on non-Mac Posix platforms, and turns on dead code stripping for Mac builds. Adds functionality to the gcc toolchain template to be able to insert strings before and after the libs. Adds a wrapper template for android toolchains that sets these accordingly to get the gross Android crtbegin/end files inserted in the right place on the linker line. Made the android_ndk_root variable relative to the source root rather than the system root. Uses of this now rebase according to their own needs which makes some of the arguments a lot easier to follow. Build file updates for base and libevent for Android. Implement ashmem library. The only change on desktop linux is the addition of -Wl,--fatal-warnings to the linker line. R=ajwong@chromium.org, cjhopman@chromium.org, scottmg@chromium.org Review URL: https://codereview.chromium.org/275703003 git-svn-id: http://src.chromium.org/svn/trunk/src/build@270138 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-05-13 21:41:06 +04:00
sysroot = rebase_path("$android_ndk_root/$arm_android_sysroot_subdir")
} else if (current_cpu == "mipsel") {
Make GN Android build link executables. Some minor tweaks in STL usage in GN itself to enable it to compile using the Android version of the STL. Enable this in the build (not so much because we need a GN binary on Android, but for build verification purposes). Moved the executable_ldconfig config from the linux file to the gcc one since its shared between the Linux and Android builds. Added "-Bdynamic" and "-Wl,-z,nocopyreloc" to this on Android. Moved some sysroot path components from sysroot.gni to android/config.gni (which sysroot uses) so it can be shared with the toolchain definitions. Added the android_full_debug build flag. Made the "optimize off" mode of the build match the GYP build's "light optimization" on Android contingent on this flag. Pulls out the optimize and optimize_max shared flags into one list to avoid duplication. Adds a bunch of linker optimization flags that should be passed on non-Mac Posix platforms, and turns on dead code stripping for Mac builds. Adds functionality to the gcc toolchain template to be able to insert strings before and after the libs. Adds a wrapper template for android toolchains that sets these accordingly to get the gross Android crtbegin/end files inserted in the right place on the linker line. Made the android_ndk_root variable relative to the source root rather than the system root. Uses of this now rebase according to their own needs which makes some of the arguments a lot easier to follow. Build file updates for base and libevent for Android. Implement ashmem library. The only change on desktop linux is the addition of -Wl,--fatal-warnings to the linker line. R=ajwong@chromium.org, cjhopman@chromium.org, scottmg@chromium.org Review URL: https://codereview.chromium.org/275703003 git-svn-id: http://src.chromium.org/svn/trunk/src/build@270138 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-05-13 21:41:06 +04:00
sysroot = rebase_path("$android_ndk_root/$mips_android_sysroot_subdir")
} else if (current_cpu == "x64") {
sysroot = rebase_path("$android_ndk_root/$x86_64_android_sysroot_subdir")
} else if (current_cpu == "arm64") {
sysroot = rebase_path("$android_ndk_root/$arm64_android_sysroot_subdir")
} else if (current_cpu == "mips64") {
sysroot = rebase_path("$android_ndk_root/$mips64_android_sysroot_subdir")
} else {
sysroot = ""
}
} else {
sysroot = ""
}
} else if (is_linux && is_chrome_branded && is_official_build && !is_chromeos) {
# For official builds, use the sysroot checked into the internal source repo
# so that the builds work on older versions of Linux.
if (current_cpu == "x64") {
sysroot =
rebase_path("//chrome/installer/linux/debian_wheezy_amd64-sysroot")
} else if (current_cpu == "x86") {
sysroot = rebase_path("//chrome/installer/linux/debian_wheezy_i386-sysroot")
} else {
# Any other builds don't use a sysroot.
sysroot = ""
}
} else if (is_linux && !is_chromeos) {
if (current_cpu == "mipsel") {
sysroot = rebase_path("//mipsel-sysroot/sysroot")
} else {
sysroot = ""
}
} else if (is_mac) {
import("//build/config/mac/mac_sdk.gni")
sysroot = mac_sdk_path
} else if (is_ios) {
import("//build/config/ios/ios_sdk.gni")
sysroot = ios_sdk_path
} else {
sysroot = ""
}