Commit c4121b28 authored by machenbach's avatar machenbach Committed by Commit bot

[android] Configure building android with ninja and clang.

Make clang dir absolute to avoid differences between ninja
and make gyp generator.

BUG=chromium:502176
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#29341}
parent 39608e17
......@@ -130,7 +130,7 @@ if __name__ == '__main__':
# Generate for the architectures supported on the given platform.
gyp_args = list(args)
gyp_generators = os.environ.get('GYP_GENERATORS')
gyp_generators = os.environ.get('GYP_GENERATORS', '')
if platform.system() == 'Linux' and gyp_generators != 'ninja':
# Work around for crbug.com/331475.
for f in glob.glob(os.path.join(v8_root, 'out', 'Makefile.*')):
......@@ -140,4 +140,13 @@ if __name__ == '__main__':
# -Goutput_dir defines where the build output goes, relative to the
# Makefile. Set it to . so that the build output doesn't end up in out/out.
gyp_args.append('-Goutput_dir=.')
gyp_defines = os.environ.get('GYP_DEFINES', '')
# Automatically turn on crosscompile support for platforms that need it.
if all(('ninja' in gyp_generators,
'OS=android' in gyp_defines,
'GYP_CROSSCOMPILE' not in os.environ)):
os.environ['GYP_CROSSCOMPILE'] = '1'
run_gyp(gyp_args)
......@@ -67,7 +67,9 @@
},
'host_arch%': '<(host_arch)',
'target_arch%': '<(host_arch)',
'base_dir%': '<!(cd <(DEPTH) && python -c "import os; print os.getcwd()")',
},
'base_dir%': '<(base_dir)',
'host_arch%': '<(host_arch)',
'target_arch%': '<(target_arch)',
'v8_target_arch%': '<(target_arch)',
......@@ -84,7 +86,7 @@
# library. This is intended to be used for instrumented builds.
'use_custom_libcxx%': 0,
'clang_dir%': 'third_party/llvm-build/Release+Asserts',
'clang_dir%': '<(base_dir)/third_party/llvm-build/Release+Asserts',
# goma settings.
# 1 to use goma.
......@@ -105,6 +107,7 @@
}],
],
},
'base_dir%': '<(base_dir)',
'clang_dir%': '<(clang_dir)',
'host_arch%': '<(host_arch)',
'host_clang%': '<(host_clang)',
......@@ -215,7 +218,7 @@
'variables': {
# The Android toolchain needs to use the absolute path to the NDK
# because it is used at different levels in the GYP files.
'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
'android_ndk_root%': '<(base_dir)/third_party/android_tools/ndk/',
'android_host_arch%': "<!(uname -m | sed -e 's/i[3456]86/x86/')",
'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
},
......@@ -303,8 +306,8 @@
'android_stlport_library': 'stlport_static',
}], # OS=="android"
['host_clang==1', {
'host_cc': '../<(clang_dir)/bin/clang',
'host_cxx': '../<(clang_dir)/bin/clang++',
'host_cc': '<(clang_dir)/bin/clang',
'host_cxx': '<(clang_dir)/bin/clang++',
}, {
'host_cc': '<!(which gcc)',
'host_cxx': '<!(which g++)',
......@@ -986,8 +989,8 @@
}],
['clang!=1 and host_clang==1 and target_arch!="ia32" and target_arch!="x64"', {
'make_global_settings': [
['CC.host', '../<(clang_dir)/bin/clang'],
['CXX.host', '../<(clang_dir)/bin/clang++'],
['CC.host', '<(clang_dir)/bin/clang'],
['CXX.host', '<(clang_dir)/bin/clang++'],
],
}],
['clang==0 and host_clang==1 and target_arch!="ia32" and target_arch!="x64"', {
......@@ -1012,8 +1015,8 @@
['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
'and OS!="win" and "<(GENERATOR)"=="make"', {
'make_global_settings': [
['CC', '../<(clang_dir)/bin/clang'],
['CXX', '../<(clang_dir)/bin/clang++'],
['CC', '<(clang_dir)/bin/clang'],
['CXX', '<(clang_dir)/bin/clang++'],
['CC.host', '$(CC)'],
['CXX.host', '$(CXX)'],
],
......@@ -1030,7 +1033,7 @@
['clang==1 and OS=="win"', {
'make_global_settings': [
# On Windows, gyp's ninja generator only looks at CC.
['CC', '../<(clang_dir)/bin/clang-cl'],
['CC', '<(clang_dir)/bin/clang-cl'],
],
}],
# TODO(yyanagisawa): supports GENERATOR==make
......
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