Makes it possible to build ndk-apks of native unit tests if the workspace is inside a chromium checkout.

Alternative solution to http://webrtc-codereview.appspot.com/1748004/.

BUG=N/A
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1753006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4294 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org 2013-07-03 21:50:33 +00:00
parent d900e8bea8
commit 1303af31d6
4 changed files with 87 additions and 1 deletions

View File

@ -0,0 +1,44 @@
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
# This file exists in two versions. A no-op version under
# webrtc/build/apk_tests_noop.gyp and this one. This gyp file builds the apk
# unit tests (for Android) assuming that WebRTC is built inside a Chromium
# workspace. The no-op version is included when building WebRTC without
# Chromium. This is a workaround for the fact that 'includes' don't expand
# variables and that the relative location of apk_test.gypi is different for
# WebRTC when built as part of Chromium and when it is built without Chromium.
{
'includes': [
'../build/common.gypi',
],
'targets': [
{
'target_name': 'modules_unittests_apk',
'type': 'none',
'conditions': [
# TODO(henrike): remove build_with_chromium==1 when the bots are using
# Chromium's buildbots.
['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
'variables': {
'test_suite_name': 'modules_unittests',
'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)modules_unittests<(SHARED_LIB_SUFFIX)',
},
'dependencies': [
'<(webrtc_root)/modules/modules.gyp:modules_unittests',
],
'includes': [
'../../../build/apk_test.gypi',
],
}],
],
},
]
}

View File

@ -0,0 +1,16 @@
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
# See webrtc/build/apk_tests.gyp for more information about this file.
{
'targets': [
{
'target_name': 'modules_unittests_apk',
'type': 'none',
}],
}

View File

@ -25,14 +25,17 @@
'conditions': [
['build_with_chromium==1 or build_with_libjingle==1', {
'webrtc_root%': '<(DEPTH)/third_party/webrtc',
'apk_tests_path%': '<(DEPTH)/third_party/webrtc/build/apk_tests.gyp',
}, {
'webrtc_root%': '<(DEPTH)/webrtc',
'apk_tests_path%': '<(DEPTH)/webrtc/build/apk_test_noop.gyp',
}],
],
},
'build_with_chromium%': '<(build_with_chromium)',
'build_with_libjingle%': '<(build_with_libjingle)',
'webrtc_root%': '<(webrtc_root)',
'apk_tests_path%': '<(apk_tests_path)',
'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8',
'include_opus%': 1,
@ -40,6 +43,7 @@
'build_with_chromium%': '<(build_with_chromium)',
'build_with_libjingle%': '<(build_with_libjingle)',
'webrtc_root%': '<(webrtc_root)',
'apk_tests_path%': '<(apk_tests_path)',
'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
'include_opus%': '<(include_opus)',

View File

@ -63,7 +63,7 @@
'targets': [
{
'target_name': 'modules_unittests',
'type': 'executable',
'type': '<(gtest_target_type)',
'dependencies': [
'audio_coding_module',
'audio_processing',
@ -246,6 +246,13 @@
'<(DEPTH)/third_party/libvpx/libvpx.gyp:libvpx',
],
}],
# TODO(henrike): remove build_with_chromium==1 when the bots are
# using Chromium's buildbots.
['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
'dependencies': [
'<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
],
}],
],
# Disable warnings to enable Win64 build, issue 1323.
'msvs_disabled_warnings': [
@ -300,6 +307,21 @@
],
},
],
'conditions': [
# TODO(henrike): remove build_with_chromium==1 when the bots are using
# Chromium's buildbots.
['OS=="build_with_chromium==1 and android" and gtest_target_type=="shared_library"', {
'targets': [
{
'target_name': 'modules_unittests_apk_target',
'type': 'none',
'dependencies': [
'<(apk_tests_path):modules_unittests_apk',
],
}
],
}],
]
}], # include_tests
], # conditions
}