OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//build/config/mac/mac_sdk.gni") | 5 import("//build/config/mac/mac_sdk.gni") |
6 import("//testing/test.gni") | 6 import("//testing/test.gni") |
7 | 7 |
8 component("sandbox") { | |
9 sources = [ | |
10 "bootstrap_sandbox.cc", | |
11 "bootstrap_sandbox.h", | |
12 "dispatch_source_mach.cc", | |
13 "dispatch_source_mach.h", | |
14 "launchd_interception_server.cc", | |
15 "launchd_interception_server.h", | |
16 "mach_message_server.cc", | |
17 "mach_message_server.h", | |
18 "message_server.h", | |
19 "os_compatibility.cc", | |
20 "os_compatibility.h", | |
21 "policy.cc", | |
22 "policy.h", | |
23 "xpc.cc", | |
24 "xpc.h", | |
25 "xpc_message_server.cc", | |
26 "xpc_message_server.h", | |
27 ] | |
28 | |
29 defines = [ "SANDBOX_IMPLEMENTATION" ] | |
30 libs = [ "bsm" ] | |
31 | |
32 deps = [ | |
33 "//base", | |
34 ] | |
35 | |
36 # When the build SDK is 10.6, generate a dynamic stub loader. When the | |
37 # SDK is higher, then libxpc.dylib will be loaded automatically as part | |
38 # of libSystem, and only forward declarations of private symbols are | |
39 # necessary. | |
40 if (mac_sdk_version == "10.6") { | |
41 deps += [ ":generate_stubs" ] | |
42 } | |
43 } | |
44 | |
45 generate_stubs_script = "//tools/generate_stubs/generate_stubs.py" | 8 generate_stubs_script = "//tools/generate_stubs/generate_stubs.py" |
46 generate_stubs_header = "xpc_stubs_header.fragment" | 9 generate_stubs_header = "xpc_stubs_header.fragment" |
47 generate_stubs_sig_public = "xpc_stubs.sig" | 10 generate_stubs_sig_public = "xpc_stubs.sig" |
48 generate_stubs_sig_private = "xpc_private_stubs.sig" | 11 generate_stubs_sig_private = "xpc_private_stubs.sig" |
49 generate_stubs_project = "sandbox/mac" | 12 generate_stubs_project = "sandbox/mac" |
50 generate_stubs_output_stem = "xpc_stubs" | 13 generate_stubs_output_stem = "xpc_stubs" |
51 | 14 |
52 action("generate_stubs") { | 15 action("generate_stubs") { |
53 script = generate_stubs_script | 16 script = generate_stubs_script |
54 sources = [ | 17 sources = [ |
(...skipping 19 matching lines...) Expand all Loading... |
74 "-s", | 37 "-s", |
75 generate_stubs_output_stem, | 38 generate_stubs_output_stem, |
76 "-p", | 39 "-p", |
77 generate_stubs_project, | 40 generate_stubs_project, |
78 "-x", | 41 "-x", |
79 "SANDBOX_EXPORT", | 42 "SANDBOX_EXPORT", |
80 ] | 43 ] |
81 args += rebase_path(sources, root_build_dir) | 44 args += rebase_path(sources, root_build_dir) |
82 } | 45 } |
83 | 46 |
| 47 component("sandbox") { |
| 48 sources = [ |
| 49 "bootstrap_sandbox.cc", |
| 50 "bootstrap_sandbox.h", |
| 51 "dispatch_source_mach.cc", |
| 52 "dispatch_source_mach.h", |
| 53 "launchd_interception_server.cc", |
| 54 "launchd_interception_server.h", |
| 55 "mach_message_server.cc", |
| 56 "mach_message_server.h", |
| 57 "message_server.h", |
| 58 "os_compatibility.cc", |
| 59 "os_compatibility.h", |
| 60 "policy.cc", |
| 61 "policy.h", |
| 62 "xpc.cc", |
| 63 "xpc.h", |
| 64 "xpc_message_server.cc", |
| 65 "xpc_message_server.h", |
| 66 ] |
| 67 |
| 68 defines = [ "SANDBOX_IMPLEMENTATION" ] |
| 69 libs = [ "bsm" ] |
| 70 |
| 71 deps = [ |
| 72 "//base", |
| 73 ] |
| 74 |
| 75 # When the build SDK is 10.6, generate a dynamic stub loader. When the |
| 76 # SDK is higher, then libxpc.dylib will be loaded automatically as part |
| 77 # of libSystem, and only forward declarations of private symbols are |
| 78 # necessary. |
| 79 if (mac_sdk_version == "10.6") { |
| 80 deps += [ ":generate_stubs" ] |
| 81 sources += get_target_outputs(":generate_stubs") |
| 82 } |
| 83 } |
| 84 |
84 test("sandbox_mac_unittests") { | 85 test("sandbox_mac_unittests") { |
85 sources = [ | 86 sources = [ |
86 "bootstrap_sandbox_unittest.mm", | 87 "bootstrap_sandbox_unittest.mm", |
87 "dispatch_source_mach_unittest.cc", | 88 "dispatch_source_mach_unittest.cc", |
88 "policy_unittest.cc", | 89 "policy_unittest.cc", |
89 "xpc_message_server_unittest.cc", | 90 "xpc_message_server_unittest.cc", |
90 ] | 91 ] |
91 | 92 |
92 libs = [ | 93 libs = [ |
93 "CoreFoundation.framework", | 94 "CoreFoundation.framework", |
94 "Foundation.framework", | 95 "Foundation.framework", |
95 ] | 96 ] |
96 | 97 |
97 deps = [ | 98 deps = [ |
98 ":sandbox", | 99 ":sandbox", |
99 "//base", | 100 "//base", |
100 "//base/test:run_all_unittests", | 101 "//base/test:run_all_unittests", |
101 "//testing/gtest", | 102 "//testing/gtest", |
102 ] | 103 ] |
103 } | 104 } |
OLD | NEW |