title: Building a simple library with bazel, fixing include path
body: <p>I have a very simple directory structure:</p>
  
  <pre><code>.
  ├── libs
  │   └── foo
  │       ├── BUILD
  │       ├── include
  │       │   └── foo
  │       │       └── func.h
  │       └── src
  │           └── func.cxx
  └── WORKSPACE
  </code></pre>
  
  <p>With <code>func.h</code>:</p>
  
  <pre><code>#pragma once
  
  int square(int );
  </code></pre>
  
  <p>And <code>func.cxx</code>:</p>
  
  <pre><code>#include &lt;foo/func.h&gt;
  
  int square(int i) { return i * i; }
  </code></pre>
  
  <p>And <code>BUILD</code>:</p>
  
  <pre><code>cc_library(
      name = "foo",
      srcs = ["src/func.cxx"],
      hdrs = ["include/foo/func.h"],
      visibility = ["//visibility:public"],
  )
  </code></pre>
  
  <p>This fails to build:</p>
  
  <pre><code>$ bazel build //libs/foo
  INFO: Analysed target //libs/foo:foo (0 packages loaded).
  INFO: Found 1 target...
  ERROR: /home/brevzin/sandbox/bazel/libs/foo/BUILD:1:1: C++ compilation of rule '//libs/foo:foo' failed (Exit 1)
  libs/foo/src/func.cxx:1:22: fatal error: foo/func.h: No such file or directory
   #include &lt;foo/func.h&gt;
                        ^
  compilation terminated.
  Target //libs/foo:foo failed to build
  Use --verbose_failures to see the command lines of failed build steps.
  INFO: Elapsed time: 0.299s, Critical Path: 0.02s
  FAILED: Build did NOT complete successfully
  </code></pre>
  
  <p>How do I set the include path properly? I tried using <code>include_prefix</code> (whether <code>include</code> or <code>include/foo</code>) but that didn't change the behavior. </p>