Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Unified Diff: sandbox/linux/sandbox_linux.gypi

Issue 11612014: Linux sandbox: modify GYP files to compile under Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add linux_syscalls.h Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/sandbox_bpf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/sandbox_linux.gypi
diff --git a/sandbox/linux/sandbox_linux.gypi b/sandbox/linux/sandbox_linux.gypi
index 9283d6af57dd5131ed52ae4066a3a792a3402e51..936b3f6c2eeb6500944049e2bf9d2319b77aea94 100644
--- a/sandbox/linux/sandbox_linux.gypi
+++ b/sandbox/linux/sandbox_linux.gypi
@@ -3,6 +3,38 @@
# found in the LICENSE file.
{
+ 'variables': {
+ 'conditions': [
+ ['OS=="linux"', {
+ 'compile_suid_client': 1,
+ }, {
+ 'compile_suid_client': 0,
+ }],
+ ['(OS=="linux" or OS=="android") and (target_arch=="ia32" '
+ 'or target_arch=="x64" or target_arch=="arm")', {
+ 'compile_seccomp_bpf': 1,
+ }, {
+ 'compile_seccomp_bpf': 0,
+ }],
+ ],
+ },
+ 'target_defaults': {
+ 'target_conditions': [
+ # All linux/ files will automatically be excluded on Android
+ # so make sure we re-include them explicitly.
+ ['OS == "android"', {
+ 'sources/': [
+ ['include', '^linux/'],
+ # TODO(jln): some files don't yet even compile on Android.
+ # crbug.com/166704
+ ['exclude', 'errorcode_unittest\\.cc$'],
+ ['exclude', 'sandbox_bpf\\.cc$'],
+ ['exclude', 'sandbox_bpf_unittest\\.cc$'],
+ ['exclude', 'syscall_unittest\\.cc$'],
+ ],
+ }],
+ ],
+ },
'targets': [
# We have two principal targets: sandbox and sandbox_linux_unittests
# All other targets are listed as dependencies.
@@ -12,10 +44,14 @@
'target_name': 'sandbox',
'type': 'none',
'dependencies': [
- 'suid_sandbox_client',
'sandbox_services',
],
'conditions': [
+ [ 'compile_suid_client==1', {
+ 'dependencies': [
+ 'suid_sandbox_client',
+ ],
+ }],
# Only compile in the seccomp mode 1 code for the flag combination
# where we support it.
[ 'OS=="linux" and (target_arch=="ia32" or target_arch=="x64") '
@@ -25,8 +61,7 @@
],
}],
# Similarly, compile seccomp BPF when we support it
- [ 'OS=="linux" and (target_arch=="ia32" or target_arch=="x64" '
- 'or target_arch=="arm")', {
+ [ 'compile_seccomp_bpf==1', {
'type': 'static_library',
'dependencies': [
'seccomp_bpf',
@@ -36,7 +71,7 @@
},
{
'target_name': 'sandbox_linux_unittests',
- 'type': 'executable',
+ 'type': '<(gtest_target_type)',
'dependencies': [
'sandbox',
'../testing/gtest.gyp:gtest',
@@ -45,15 +80,18 @@
'tests/main.cc',
'tests/unit_tests.cc',
'tests/unit_tests.h',
- 'suid/client/setuid_sandbox_client_unittest.cc',
'services/broker_process_unittest.cc',
],
'include_dirs': [
'../..',
],
'conditions': [
- [ 'OS=="linux" and (target_arch=="ia32" or target_arch=="x64" '
- 'or target_arch=="arm")', {
+ [ 'compile_suid_client==1', {
+ 'sources': [
+ 'suid/client/setuid_sandbox_client_unittest.cc',
+ ],
+ }],
+ [ 'compile_seccomp_bpf==1', {
'sources': [
'seccomp-bpf/bpf_tests.h',
'seccomp-bpf/codegen_unittest.cc',
@@ -162,4 +200,25 @@
},
],
+ 'conditions': [
+ # Strategy copied from base_unittests_apk in base/base.gyp.
+ [ 'OS=="android" and gtest_target_type == "shared_library"', {
+ 'targets': [
+ {
+ 'target_name': 'sandbox_linux_unittests_apk',
+ 'type': 'none',
+ 'dependencies': [
+ 'sandbox_linux_unittests',
+ ],
+ 'variables': {
+ 'test_suite_name': 'sandbox_linux_unittests',
+ 'input_shlib_path':
+ '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)sandbox_linux_unittests'
+ '<(SHARED_LIB_SUFFIX)',
+ },
+ 'includes': [ '../../build/apk_test.gypi' ],
+ }
+ ],
+ }],
+ ],
}
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/sandbox_bpf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698