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")
9 "bootstrap_sandbox.cc",
10 "bootstrap_sandbox.h",
11 "dispatch_source_mach.cc",
12 "dispatch_source_mach.h",
13 "launchd_interception_server.cc",
14 "launchd_interception_server.h",
15 "mach_message_server.cc",
16 "mach_message_server.h",
18 "os_compatibility.cc",
24 "xpc_message_server.cc",
25 "xpc_message_server.h",
28 defines = [ "SANDBOX_IMPLEMENTATION" ]
35 # When the build SDK is 10.6, generate a dynamic stub loader. When the
36 # SDK is higher, then libxpc.dylib will be loaded automatically as part
37 # of libSystem, and only forward declarations of private symbols are
39 if (mac_sdk_version == "10.6") {
40 deps += [ ":generate_stubs" ]
44 generate_stubs_script = "//tools/generate_stubs/generate_stubs.py"
45 generate_stubs_header = "xpc_stubs_header.fragment"
46 generate_stubs_sig_public = "xpc_stubs.sig"
47 generate_stubs_sig_private = "xpc_private_stubs.sig"
48 generate_stubs_project = "sandbox/mac"
49 generate_stubs_output_stem = "xpc_stubs"
51 action("generate_stubs") {
52 script = generate_stubs_script
53 sources = [ generate_stubs_sig_public, generate_stubs_sig_private ]
54 inputs = [ generate_stubs_header ]
56 "$target_gen_dir/$generate_stubs_output_stem.cc",
57 "$target_gen_dir/$generate_stubs_output_stem.h",
60 "-i", rebase_path(target_gen_dir, root_build_dir),
61 "-o", rebase_path(target_gen_dir, root_build_dir),
63 "-e", rebase_path(generate_stubs_header, root_build_dir),
64 "-s", generate_stubs_output_stem,
65 "-p", generate_stubs_project,
66 "-x", "SANDBOX_EXPORT",
68 args += rebase_path(sources, root_build_dir)
71 test("sandbox_mac_unittests") {
73 "bootstrap_sandbox_unittest.mm",
74 "dispatch_source_mach_unittest.cc",
76 "xpc_message_server_unittest.cc",
80 "CoreFoundation.framework",
81 "Foundation.framework",
87 "//base/test:run_all_unittests",