Home | History | Annotate | Download | only in embedder
      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.
      4 
      5 import("//build/config/nacl/config.gni")
      6 
      7 source_set("headers") {
      8   sources = [
      9     "configuration.h",
     10     "connection_params.h",
     11     "embedder.h",
     12     "embedder_internal.h",
     13     "named_platform_channel_pair.h",
     14     "named_platform_handle.h",
     15     "named_platform_handle_utils.h",
     16     "pending_process_connection.h",
     17     "platform_channel_pair.h",
     18     "platform_handle.h",
     19     "platform_handle_utils.h",
     20     "scoped_platform_handle.h",
     21   ]
     22 
     23   public_deps = [
     24     "//base",
     25     "//mojo/public/cpp/system",
     26   ]
     27 }
     28 
     29 source_set("embedder") {
     30   # This isn't really a standalone target; it must be linked into the
     31   # mojo_system_impl component.
     32   visibility = [
     33     "//mojo/edk/system",
     34     "//components/nacl:nacl",
     35   ]
     36 
     37   sources = [
     38     "configuration.h",
     39     "connection_params.cc",
     40     "connection_params.h",
     41     "embedder.cc",
     42     "embedder.h",
     43     "embedder_internal.h",
     44     "entrypoints.cc",
     45     "entrypoints.h",
     46     "pending_process_connection.cc",
     47     "scoped_ipc_support.cc",
     48     "scoped_ipc_support.h",
     49 
     50     # Test-only code:
     51     # TODO(vtl): It's a little unfortunate that these end up in the same
     52     # component as non-test-only code. In the static build, this code should
     53     # hopefully be dead-stripped.
     54     "test_embedder.cc",
     55     "test_embedder.h",
     56   ]
     57 
     58   defines = [ "MOJO_SYSTEM_IMPL_IMPLEMENTATION" ]
     59 
     60   public_deps = [
     61     ":headers",
     62     ":platform",
     63     "//base",
     64     "//mojo/public/cpp/system",
     65   ]
     66 
     67   if (!is_nacl) {
     68     deps = [
     69       "//crypto",
     70     ]
     71   }
     72 }
     73 
     74 source_set("platform") {
     75   # This isn't really a standalone target; it must be linked into the
     76   # mojo_system_impl component.
     77   visibility = [
     78     ":embedder",
     79     "//mojo/edk/system",
     80   ]
     81 
     82   sources = [
     83     "named_platform_channel_pair.h",
     84     "named_platform_channel_pair_win.cc",
     85     "named_platform_handle.h",
     86     "named_platform_handle_utils.h",
     87     "named_platform_handle_utils_win.cc",
     88     "platform_channel_pair.cc",
     89     "platform_channel_pair.h",
     90     "platform_channel_pair_posix.cc",
     91     "platform_channel_pair_win.cc",
     92     "platform_channel_utils_posix.cc",
     93     "platform_channel_utils_posix.h",
     94     "platform_handle.cc",
     95     "platform_handle.h",
     96     "platform_handle_utils.h",
     97     "platform_handle_utils_posix.cc",
     98     "platform_handle_utils_win.cc",
     99     "platform_handle_vector.h",
    100     "platform_shared_buffer.cc",
    101     "platform_shared_buffer.h",
    102     "scoped_platform_handle.h",
    103   ]
    104   if (!is_nacl) {
    105     sources += [ "named_platform_handle_utils_posix.cc" ]
    106   }
    107 
    108   defines = [ "MOJO_SYSTEM_IMPL_IMPLEMENTATION" ]
    109 
    110   public_deps = [
    111     "//mojo/public/cpp/system",
    112   ]
    113 
    114   deps = [
    115     "//base",
    116   ]
    117 
    118   if (is_android) {
    119     deps += [ "//third_party/ashmem" ]
    120   }
    121 
    122   if (is_nacl && !is_nacl_nonsfi) {
    123     sources -= [ "platform_channel_utils_posix.cc" ]
    124   }
    125 }
    126 
    127 source_set("embedder_unittests") {
    128   testonly = true
    129 
    130   # TODO: Figure out why this visibility check fails on Android.
    131   # visibility = [ "//mojo/edk/system:mojo_system_unittests" ]
    132 
    133   sources = [
    134     "embedder_unittest.cc",
    135     "platform_channel_pair_posix_unittest.cc",
    136     "platform_shared_buffer_unittest.cc",
    137   ]
    138 
    139   deps = [
    140     "//base",
    141     "//base/test:test_support",
    142     "//mojo/edk/system",
    143     "//mojo/edk/system:test_utils",
    144     "//mojo/edk/test:test_support",
    145     "//testing/gtest",
    146   ]
    147 }
    148