Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / sandbox / mac / BUILD.gn
index e615197..3833b8a 100644 (file)
@@ -2,19 +2,27 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("//build/config/mac/mac_sdk.gni")
+
 component("sandbox") {
   sources = [
     "bootstrap_sandbox.cc",
     "bootstrap_sandbox.h",
+    "dispatch_source_mach.cc",
+    "dispatch_source_mach.h",
     "launchd_interception_server.cc",
     "launchd_interception_server.h",
     "mach_message_server.cc",
     "mach_message_server.h",
+    "message_server.h",
     "os_compatibility.cc",
     "os_compatibility.h",
     "policy.cc",
     "policy.h",
+    "xpc.cc",
     "xpc.h",
+    "xpc_message_server.cc",
+    "xpc_message_server.h",
   ]
 
   defines = [ "SANDBOX_IMPLEMENTATION" ]
@@ -22,8 +30,15 @@ component("sandbox") {
 
   deps = [
     "//base",
-    ":generate_stubs",
   ]
+
+  # When the build SDK is 10.6, generate a dynamic stub loader. When the
+  # SDK is higher, then libxpc.dylib will be loaded automatically as part
+  # of libSystem, and only forward declarations of private symbols are
+  # necessary.
+  if (mac_sdk_version == "10.6") {
+    deps += [ ":generate_stubs" ]
+  }
 }
 
 generate_stubs_script = "//tools/generate_stubs/generate_stubs.py"
@@ -36,7 +51,7 @@ generate_stubs_output_stem = "xpc_stubs"
 action("generate_stubs") {
   script = generate_stubs_script
   sources = [ generate_stubs_sig_public, generate_stubs_sig_private ]
-  source_prereqs = [ generate_stubs_header ]
+  inputs = [ generate_stubs_header ]
   outputs = [
     "$target_gen_dir/$generate_stubs_output_stem.cc",
     "$target_gen_dir/$generate_stubs_output_stem.h",
@@ -48,6 +63,7 @@ action("generate_stubs") {
     "-e", rebase_path(generate_stubs_header, root_build_dir),
     "-s", generate_stubs_output_stem,
     "-p", generate_stubs_project,
+    "-x", "SANDBOX_EXPORT",
   ]
   args += rebase_path(sources, root_build_dir)
 }
@@ -55,7 +71,9 @@ action("generate_stubs") {
 test("sandbox_mac_unittests") {
   sources = [
     "bootstrap_sandbox_unittest.mm",
+    "dispatch_source_mach_unittest.cc",
     "policy_unittest.cc",
+    "xpc_message_server_unittest.cc",
   ]
 
   libs = [