| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 { | 5 { |
| 6 'variables': { |
| 7 'conditions': [ |
| 8 ['OS=="linux"', { |
| 9 'compile_suid_client': 1, |
| 10 }, { |
| 11 'compile_suid_client': 0, |
| 12 }], |
| 13 ['(OS=="linux" or OS=="android") and (target_arch=="ia32" ' |
| 14 'or target_arch=="x64" or target_arch=="arm")', { |
| 15 'compile_seccomp_bpf': 1, |
| 16 }, { |
| 17 'compile_seccomp_bpf': 0, |
| 18 }], |
| 19 ], |
| 20 }, |
| 21 'target_defaults': { |
| 22 'target_conditions': [ |
| 23 # All linux/ files will automatically be excluded on Android |
| 24 # so make sure we re-include them explicitly. |
| 25 ['OS == "android"', { |
| 26 'sources/': [ |
| 27 ['include', '^linux/'], |
| 28 # TODO(jln): some files don't yet even compile on Android. |
| 29 # crbug.com/166704 |
| 30 ['exclude', 'errorcode_unittest\\.cc$'], |
| 31 ['exclude', 'sandbox_bpf\\.cc$'], |
| 32 ['exclude', 'sandbox_bpf_unittest\\.cc$'], |
| 33 ['exclude', 'syscall_unittest\\.cc$'], |
| 34 ], |
| 35 }], |
| 36 ], |
| 37 }, |
| 6 'targets': [ | 38 'targets': [ |
| 7 # We have two principal targets: sandbox and sandbox_linux_unittests | 39 # We have two principal targets: sandbox and sandbox_linux_unittests |
| 8 # All other targets are listed as dependencies. | 40 # All other targets are listed as dependencies. |
| 9 # FIXME(jln): for historial reasons, sandbox_linux is the setuid sandbox | 41 # FIXME(jln): for historial reasons, sandbox_linux is the setuid sandbox |
| 10 # and is its own target. | 42 # and is its own target. |
| 11 { | 43 { |
| 12 'target_name': 'sandbox', | 44 'target_name': 'sandbox', |
| 13 'type': 'none', | 45 'type': 'none', |
| 14 'dependencies': [ | 46 'dependencies': [ |
| 15 'suid_sandbox_client', | |
| 16 'sandbox_services', | 47 'sandbox_services', |
| 17 ], | 48 ], |
| 18 'conditions': [ | 49 'conditions': [ |
| 50 [ 'compile_suid_client==1', { |
| 51 'dependencies': [ |
| 52 'suid_sandbox_client', |
| 53 ], |
| 54 }], |
| 19 # Only compile in the seccomp mode 1 code for the flag combination | 55 # Only compile in the seccomp mode 1 code for the flag combination |
| 20 # where we support it. | 56 # where we support it. |
| 21 [ 'OS=="linux" and (target_arch=="ia32" or target_arch=="x64") ' | 57 [ 'OS=="linux" and (target_arch=="ia32" or target_arch=="x64") ' |
| 22 'and toolkit_views==0 and selinux==0', { | 58 'and toolkit_views==0 and selinux==0', { |
| 23 'dependencies': [ | 59 'dependencies': [ |
| 24 'linux/seccomp-legacy/seccomp.gyp:seccomp_sandbox', | 60 'linux/seccomp-legacy/seccomp.gyp:seccomp_sandbox', |
| 25 ], | 61 ], |
| 26 }], | 62 }], |
| 27 # Similarly, compile seccomp BPF when we support it | 63 # Similarly, compile seccomp BPF when we support it |
| 28 [ 'OS=="linux" and (target_arch=="ia32" or target_arch=="x64" ' | 64 [ 'compile_seccomp_bpf==1', { |
| 29 'or target_arch=="arm")', { | |
| 30 'type': 'static_library', | 65 'type': 'static_library', |
| 31 'dependencies': [ | 66 'dependencies': [ |
| 32 'seccomp_bpf', | 67 'seccomp_bpf', |
| 33 ], | 68 ], |
| 34 }], | 69 }], |
| 35 ], | 70 ], |
| 36 }, | 71 }, |
| 37 { | 72 { |
| 38 'target_name': 'sandbox_linux_unittests', | 73 'target_name': 'sandbox_linux_unittests', |
| 39 'type': 'executable', | 74 'type': '<(gtest_target_type)', |
| 40 'dependencies': [ | 75 'dependencies': [ |
| 41 'sandbox', | 76 'sandbox', |
| 42 '../testing/gtest.gyp:gtest', | 77 '../testing/gtest.gyp:gtest', |
| 43 ], | 78 ], |
| 44 'sources': [ | 79 'sources': [ |
| 45 'tests/main.cc', | 80 'tests/main.cc', |
| 46 'tests/unit_tests.cc', | 81 'tests/unit_tests.cc', |
| 47 'tests/unit_tests.h', | 82 'tests/unit_tests.h', |
| 48 'suid/client/setuid_sandbox_client_unittest.cc', | |
| 49 'services/broker_process_unittest.cc', | 83 'services/broker_process_unittest.cc', |
| 50 ], | 84 ], |
| 51 'include_dirs': [ | 85 'include_dirs': [ |
| 52 '../..', | 86 '../..', |
| 53 ], | 87 ], |
| 54 'conditions': [ | 88 'conditions': [ |
| 55 [ 'OS=="linux" and (target_arch=="ia32" or target_arch=="x64" ' | 89 [ 'compile_suid_client==1', { |
| 56 'or target_arch=="arm")', { | 90 'sources': [ |
| 91 'suid/client/setuid_sandbox_client_unittest.cc', |
| 92 ], |
| 93 }], |
| 94 [ 'compile_seccomp_bpf==1', { |
| 57 'sources': [ | 95 'sources': [ |
| 58 'seccomp-bpf/bpf_tests.h', | 96 'seccomp-bpf/bpf_tests.h', |
| 59 'seccomp-bpf/codegen_unittest.cc', | 97 'seccomp-bpf/codegen_unittest.cc', |
| 60 'seccomp-bpf/errorcode_unittest.cc', | 98 'seccomp-bpf/errorcode_unittest.cc', |
| 61 'seccomp-bpf/sandbox_bpf_unittest.cc', | 99 'seccomp-bpf/sandbox_bpf_unittest.cc', |
| 62 'seccomp-bpf/syscall_iterator_unittest.cc', | 100 'seccomp-bpf/syscall_iterator_unittest.cc', |
| 63 'seccomp-bpf/syscall_unittest.cc', | 101 'seccomp-bpf/syscall_unittest.cc', |
| 64 ], | 102 ], |
| 65 }], | 103 }], |
| 66 ], | 104 ], |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 ], | 193 ], |
| 156 'dependencies': [ | 194 'dependencies': [ |
| 157 '../base/base.gyp:base', | 195 '../base/base.gyp:base', |
| 158 ], | 196 ], |
| 159 'include_dirs': [ | 197 'include_dirs': [ |
| 160 '..', | 198 '..', |
| 161 ], | 199 ], |
| 162 }, | 200 }, |
| 163 | 201 |
| 164 ], | 202 ], |
| 203 'conditions': [ |
| 204 # Strategy copied from base_unittests_apk in base/base.gyp. |
| 205 [ 'OS=="android" and gtest_target_type == "shared_library"', { |
| 206 'targets': [ |
| 207 { |
| 208 'target_name': 'sandbox_linux_unittests_apk', |
| 209 'type': 'none', |
| 210 'dependencies': [ |
| 211 'sandbox_linux_unittests', |
| 212 ], |
| 213 'variables': { |
| 214 'test_suite_name': 'sandbox_linux_unittests', |
| 215 'input_shlib_path': |
| 216 '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)sandbox_linux_unittests' |
| 217 '<(SHARED_LIB_SUFFIX)', |
| 218 }, |
| 219 'includes': [ '../../build/apk_test.gypi' ], |
| 220 } |
| 221 ], |
| 222 }], |
| 223 ], |
| 165 } | 224 } |
| OLD | NEW |