title: Tensorflow: dynamic linking with shared library
body: <p>I'm doing a shared library which uses Tensorflow. For now I placed it in Tensorflow's source tree as subproject with the following BUILD file:</p>
  
  <pre><code>cc_binary(
      name = "recognizer.so",
      srcs = glob(["recognizer.cpp"]),
      linkshared = 1,
      deps = [
          "//tensorflow:сore"
      ],
  )
  </code></pre>
  
  <p>Everything links together but I end up with a shared library about 94 megabytes in size and not depended on libtensorflow_cc.so. Actually there is even no such binary as libtensorflow_cc.so built.</p>
  
  <p>There is a target //tensorflow:libtensorflow_cc.so . It is declared as cc_binary which means (according to bazel) I cannot depend on it. Moreover this target is actually non-public, which means that I can build it but not refer to it from another subproject. At least with bazel.</p>
  
  <p>So, is there any way to do such a simple thing?</p>