Don't use m32 cflag for x86_64.

When checking the skia_arch_type for "x86", instead of doing an
== compare, check if "x86" in skia_arch_type, so it will cover
both x86 and x86_64.

Except when we specifically want x86.

Set skia_arch_width based on "64" in skia_arch_type. No need to specify
in scripts.

In gyp_to_android.py, create a separate var_dict for x86_64.

BUG=skia:3419

Review URL: https://codereview.chromium.org/916113002
This commit is contained in:
scroggo 2015-02-12 10:48:25 -08:00 коммит произвёл Commit bot
Родитель 9d7ceca350
Коммит df1c3373fc
7 изменённых файлов: 36 добавлений и 22 удалений

Просмотреть файл

@ -227,7 +227,7 @@
'conditions': [
[ 'skia_os != "chromeos"', {
'conditions': [
[ 'skia_arch_width == 64 and skia_arch_type == "x86"', {
[ 'skia_arch_type == "x86_64"', {
'cflags': [
'-m64',
],
@ -235,7 +235,7 @@
'-m64',
],
}],
[ 'skia_arch_width == 32 and skia_arch_type == "x86"', {
[ 'skia_arch_type == "x86"', {
'cflags': [
'-m32',
],
@ -628,7 +628,7 @@
'-fuse-ld=gold',
],
'conditions': [
[ 'skia_arch_type == "x86"', {
[ '"x86" in skia_arch_type', {
'cflags': [
'-mssse3',
],

Просмотреть файл

@ -40,14 +40,23 @@
# Variables needed by conditions list within the level-2 variables dict.
'variables': { # level 3
# We use 'skia_os' instead of 'OS' throughout our gyp files, to allow
# for cross-compilation (e.g. building for either MacOS or iOS on Mac).
# We set it automatically based on 'OS' (the host OS), but allow the
# user to override it via GYP_DEFINES if they like.
'skia_os%': '<(OS)',
'variables': { # level 4
# We use 'skia_os' instead of 'OS' throughout our gyp files, to allow
# for cross-compilation (e.g. building for either MacOS or iOS on Mac).
# We set it automatically based on 'OS' (the host OS), but allow the
# user to override it via GYP_DEFINES if they like.
'skia_os%': '<(OS)',
},
'skia_os%': '<(skia_os)',
'skia_android_framework%': 0,
'skia_arch_type%': 'x86',
'conditions' : [
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "mac"]', {
'skia_arch_type%': 'x86_64',
}, {
'skia_arch_type%': 'x86',
}],
],
'arm_version%': 0,
'arm_neon%': 0,
'skia_egl%': 0,
@ -82,7 +91,7 @@
}, {
'skia_poppler_enabled%': 0,
}],
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "mac"] or skia_arch_type == "arm64"', {
['"64" in skia_arch_type', {
'skia_arch_width%': 64,
}, {
'skia_arch_width%': 32,

Просмотреть файл

@ -1,3 +1,4 @@
# Gyp file for building opts target.
{
# Source lists live in opts.gypi. This makes it easier to maintain our Chrome GYP/GN setup.
# (To be honest, I'm not sure why we need to include common.gypi. I thought it was automatic.)
@ -26,7 +27,7 @@
'../include/utils',
],
'conditions': [
[ 'skia_arch_type == "x86" and skia_os != "ios"', {
[ '"x86" in skia_arch_type and skia_os != "ios"', {
'cflags': [ '-msse2' ],
'dependencies': [ 'opts_ssse3', 'opts_sse41' ],
'sources': [ '<@(sse2_sources)' ],
@ -44,7 +45,9 @@
[ '(skia_arch_type == "arm" and arm_version < 7) \
or (skia_os == "ios") \
or (skia_os == "android" and skia_arch_type not in ["x86", "arm", "mips", "arm64"])', {
or (skia_os == "android" \
and skia_arch_type not in ["x86", "x86_64", "arm", "mips", \
"arm64"])', {
'sources': [ '<@(none_sources)' ],
}],

Просмотреть файл

@ -12,7 +12,7 @@
'utils.gyp:utils',
],
'conditions': [
[ 'skia_arch_type == "x86" and skia_os != "android"', {
[ '"x86" in skia_arch_type and skia_os != "android"', {
'component_libs': [
'opts.gyp:opts_ssse3',
'opts.gyp:opts_sse41',

Просмотреть файл

@ -116,16 +116,16 @@ setup_device() {
ANDROID_ARCH="arm"
;;
intel_rhb | razr_i)
DEFINES="${DEFINES} skia_arch_type=x86 skia_arch_width=32"
DEFINES="${DEFINES} skia_arch_type=x86"
DEFINES="${DEFINES} skia_resource_cache_mb_limit=32"
ANDROID_ARCH="x86"
;;
x86)
DEFINES="${DEFINES} skia_arch_type=x86 skia_arch_width=32"
DEFINES="${DEFINES} skia_arch_type=x86"
ANDROID_ARCH="x86"
;;
x86_64 | x64)
DEFINES="${DEFINES} skia_arch_type=x86 skia_arch_width=64"
DEFINES="${DEFINES} skia_arch_type=x86_64"
ANDROID_ARCH="x86_64"
;;
arm_v7)

Просмотреть файл

@ -107,6 +107,8 @@ def main(target_dir=None, require_sk_user_config=False, gyp_source_dir=None):
True, gyp_source_dir)
x86_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'x86', False,
gyp_source_dir)
x86_64_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'x86_64',
False, gyp_source_dir)
mips_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'mips', False,
gyp_source_dir)
@ -121,8 +123,8 @@ def main(target_dir=None, require_sk_user_config=False, gyp_source_dir=None):
# should be part of the makefile always. Each dict will now contain trimmed
# lists containing only variable definitions specific to that configuration.
var_dict_list = [default_var_dict, arm_var_dict, arm_neon_var_dict,
x86_var_dict, mips_var_dict, mips64_var_dict,
arm64_var_dict]
x86_var_dict, x86_64_var_dict, mips_var_dict,
mips64_var_dict, arm64_var_dict]
common = vars_dict_lib.intersect(var_dict_list)
common.LOCAL_MODULE.add('libskia')
@ -178,8 +180,7 @@ def main(target_dir=None, require_sk_user_config=False, gyp_source_dir=None):
arm_neon_var_dict, 'arm', 'ARCH_ARM_HAVE_NEON'))
deviations_from_common.append(makefile_writer.VarsDictData(x86_var_dict,
'x86'))
# Currently, x86_64 is identical to x86
deviations_from_common.append(makefile_writer.VarsDictData(x86_var_dict,
deviations_from_common.append(makefile_writer.VarsDictData(x86_64_var_dict,
'x86_64'))
deviations_from_common.append(makefile_writer.VarsDictData(mips_var_dict,

Просмотреть файл

@ -1,3 +1,4 @@
#
{
'targets': [
{
@ -18,10 +19,10 @@
[ 'skia_arch_type == "arm64"', {
'android_arch%': "arm64-v8a",
}],
[ 'skia_arch_type == "x86" and skia_arch_width == 32', {
[ 'skia_arch_type == "x86"', {
'android_arch%': "x86",
}],
[ 'skia_arch_type == "x86" and skia_arch_width == 64', {
[ 'skia_arch_type == "x86_64"', {
'android_arch%': "x86_64",
}],
[ 'skia_arch_type == "mips" and skia_arch_width == 32', {