Commit 9dcbadfa authored by brettw@chromium.org's avatar brettw@chromium.org

Work on Android GN build.

Adds arm version and some android configuration build flags.

This adds most of the logic from common.gypi to the Android GN build.

This is currently missing the crtbegin/end stuff and won't actually make real Android builds. The logic in this patch is just the initial conversion that will require testing and several more passes of fixes.

R=torne@chromium.org, torne

Review URL: https://codereview.chromium.org/121173005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243681 0039d316-1c4b-4281-b951-d872f2087c98
parent 82110212
# Copyright 2014 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 file contains common system config stuff for the Android build.
if (is_android) {
declare_args() {
android_src = ""
# This is set when building the Android WebView inside the Android build
# system, using the 'android' gyp backend. The WebView code is still built
# when this is unset, but builds using the normal chromium build system.
is_android_webview_build = false
}
if (is_android_webview_build) {
assert(android_src != "",
"You must specify android_src for an Android WebView build.")
}
# android_ndk_root -----------------------------------------------------------
# Full system path to the Android NDK.
android_ndk_root =
rebase_path("//third_party/android_tools/ndk", ".", "")
# stlport stuff --------------------------------------------------------------
use_system_stlport = is_android_webview_build
if (use_system_stlport) {
android_stlport_library = "stlport"
} else if (component_mode == "shared_library") {
android_stlport_library = "stlport_shared"
} else {
android_stlport_library = "stlport_static"
}
# ABI ------------------------------------------------------------------------
if (cpu_arch == "x86") {
android_app_abi = "x86"
} else if (cpu_arch == "arm") {
import("//build/config/arm.gni")
if (arm_version < 7) {
android_app_abi = "armeabi"
} else {
android_app_abi = "armeabi-v7a"
}
} else if (cpu_arch == "mipsel") {
android_app_abi = "mips"
} else {
assert(false, "Unknown Android ABI")
}
} else {
if (!defined(is_android_webview_build)) {
is_android_webview_build = false
}
use_system_stlport = false
}
# Copyright 2014 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.
declare_args() {
# Version of the ARM processor when compiling on ARM. Ignored on non-ARM
# platforms.
arm_version = 7
}
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("pkg_config.gni") import("//build/config/linux/pkg_config.gni")
# Sets up the dynamic library search path to include our "lib" directory. # Sets up the dynamic library search path to include our "lib" directory.
config("executable_ldconfig") { config("executable_ldconfig") {
......
...@@ -5,9 +5,24 @@ ...@@ -5,9 +5,24 @@
# This header file defines the "sysroot" variable which is the absolute path # 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. # of the sysroot. If no sysroot applies, the variable will be an empty string.
# For official linux builds, use the sysroot checked into the internal source if (is_android) {
# repo so that the builds work on older versions of Linux. import("//build/config/android/config.gni")
if (is_linux && is_chrome_branded && is_official_build && !is_chromeos) { if (!is_android_webview_build) {
if (cpu_arch == "x86") {
sysroot = "$android_ndk_root/platforms/android-14/arch-x86"
} else if (cpu_arch == "arm") {
sysroot = "$android_ndk_root/platforms/android-14/arch-arm"
} else if (cpu_arch == "mipsel") {
sysroot = "$android_ndk_root/platforms/android-14/arch-mips"
} 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 (cpu_arch == "x64") { if (cpu_arch == "x64") {
sysroot = rebase_path( sysroot = rebase_path(
"//chrome/installer/linux/debian_wheezy_amd64-sysroot", ".", "") "//chrome/installer/linux/debian_wheezy_amd64-sysroot", ".", "")
......
...@@ -148,6 +148,7 @@ def GetArgsStringForGN(supplemental_files): ...@@ -148,6 +148,7 @@ def GetArgsStringForGN(supplemental_files):
# These tuples of (key, value, gn_arg_string) use the gn_arg_string for # These tuples of (key, value, gn_arg_string) use the gn_arg_string for
# gn when the key is set to the given value in the GYP arguments. # gn when the key is set to the given value in the GYP arguments.
remap_cases = [ remap_cases = [
('android_webview_build', '1', 'is_android_webview_build=true'),
('branding', 'Chrome', 'is_chrome_branded=true'), ('branding', 'Chrome', 'is_chrome_branded=true'),
('buildtype', 'Official', 'is_official_build=true'), ('buildtype', 'Official', 'is_official_build=true'),
('component', 'shared_library', 'is_component_build=true'), ('component', 'shared_library', 'is_component_build=true'),
...@@ -171,11 +172,17 @@ def GetArgsStringForGN(supplemental_files): ...@@ -171,11 +172,17 @@ def GetArgsStringForGN(supplemental_files):
if i[0] in vars_dict and vars_dict[i[0]] == i[1]: if i[0] in vars_dict and vars_dict[i[0]] == i[1]:
gn_args += ' ' + i[2] gn_args += ' ' + i[2]
# These string arguments get passed directly. # These string arguments get passed directly as GN strings.
for v in ['windows_sdk_path']: for v in ['android_src', 'windows_sdk_path']:
if v in vars_dict: if v in vars_dict:
gn_args += ' ' + v + '=' + EscapeStringForGN(vars_dict[v]) gn_args += ' ' + v + '=' + EscapeStringForGN(vars_dict[v])
# These arguments get passed directly as integers (avoiding the quoting and
# escaping of the string ones above).
for v in ['arm_version']:
if v in vars_dict:
gn_args += ' %s=%s' % (v, vars_dict[v])
# Some other flags come from GYP environment variables. # Some other flags come from GYP environment variables.
gyp_msvs_version = os.environ.get('GYP_MSVS_VERSION', '') gyp_msvs_version = os.environ.get('GYP_MSVS_VERSION', '')
if gyp_msvs_version: if gyp_msvs_version:
......
...@@ -2,13 +2,10 @@ ...@@ -2,13 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("../clang.gni") import("//build/config/android/config.gni")
import("../goma.gni") import("//build/toolchain/clang.gni")
import("../gcc_toolchain.gni") import("//build/toolchain/goma.gni")
import("//build/toolchain/gcc_toolchain.gni")
# Get the location of the Android tools in our tree.
android_ndk_root =
rebase_path("//third_party/android_tools/ndk", ".", "")
# Get the Android version of the name of the build host's architecture. # Get the Android version of the name of the build host's architecture.
if (build_cpu_arch == "x64") { if (build_cpu_arch == "x64") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment