title: How to include libclang as a dependency using meson?
body: <p>I am trying to use libclang for some source parsing on linux. I have libclang-dev installed and it appears under the list of packages for apt on my system.</p>
  <p>However when i try to add it as a dependency through any of:</p>
  <p><code>dependency('clang')</code>
  <code>dependency('libclang')</code>
  <code>dependency('libclang-dev')</code>
  <code>dependency('libclang-cpp-dev')</code></p>
  <p>In all cases I get</p>
  <p><code>Run-time dependency clang found: NO (tried pkgconfig and cmake)</code></p>
  <p>Despite it no being able to find it in my system I thought I could just compile it from source. To that effect I tried this:</p>
  <pre><code>opt_var = cmake.subproject_options()
  opt_var.append_link_args('-fPIC')
  sub_proj = cmake.subproject('clang', options : opt_var)
  clang = sub_proj.dependency('clang')
  </code></pre>
  <p>Which gives :</p>
  <pre><code>../subprojects/clang/meson.build:0:0: ERROR: Can't link non-PIC static library 'clangBasic' into shared library 'clang_cpp'. Use the 'pic' option to static_library to build with PIC.
  </code></pre>
  <p>I tested compilation of clang outside of meson (i.e. i made a build directory and did cmake .. &amp;&amp; make) and it works so this is a problem with how meson is calling cmake, not with the library.</p>
  <p>Any ideas?</p>