Rewrite AndroidSyncSettings to be significantly simpler.
[chromium-blink-merge.git] / sandbox / mac / BUILD.gn
blobe2c39ee0e280f59a1c8155f50652d59119510360
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
3 # found in the LICENSE file.
5 import("//build/config/mac/mac_sdk.gni")
6 import("//testing/test.gni")
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   ]
29   defines = [ "SANDBOX_IMPLEMENTATION" ]
30   libs = [ "bsm" ]
32   deps = [
33     "//base",
34   ]
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   }
45 generate_stubs_script = "//tools/generate_stubs/generate_stubs.py"
46 generate_stubs_header = "xpc_stubs_header.fragment"
47 generate_stubs_sig_public = "xpc_stubs.sig"
48 generate_stubs_sig_private = "xpc_private_stubs.sig"
49 generate_stubs_project = "sandbox/mac"
50 generate_stubs_output_stem = "xpc_stubs"
52 action("generate_stubs") {
53   script = generate_stubs_script
54   sources = [
55     generate_stubs_sig_public,
56     generate_stubs_sig_private,
57   ]
58   inputs = [
59     generate_stubs_header,
60   ]
61   outputs = [
62     "$target_gen_dir/$generate_stubs_output_stem.cc",
63     "$target_gen_dir/$generate_stubs_output_stem.h",
64   ]
65   args = [
66     "-i",
67     rebase_path(target_gen_dir, root_build_dir),
68     "-o",
69     rebase_path(target_gen_dir, root_build_dir),
70     "-t",
71     "posix_stubs",
72     "-e",
73     rebase_path(generate_stubs_header, root_build_dir),
74     "-s",
75     generate_stubs_output_stem,
76     "-p",
77     generate_stubs_project,
78     "-x",
79     "SANDBOX_EXPORT",
80   ]
81   args += rebase_path(sources, root_build_dir)
84 test("sandbox_mac_unittests") {
85   sources = [
86     "bootstrap_sandbox_unittest.mm",
87     "dispatch_source_mach_unittest.cc",
88     "policy_unittest.cc",
89     "xpc_message_server_unittest.cc",
90   ]
92   libs = [
93     "CoreFoundation.framework",
94     "Foundation.framework",
95   ]
97   deps = [
98     ":sandbox",
99     "//base",
100     "//base/test:run_all_unittests",
101     "//testing/gtest",
102   ]