title: Using LLVM C API in a Swift Xcode Project
body: <p>I'm attempting to use the LLVM C API in an Xcode project written in Swift. To do so, I am loosely following the guide <a href="http://llvm.org/devmtg/2016-01/slides/LLVM_Swift.pdf" rel="noreferrer">here</a>, but am having trouble. In the compilation step, after adding the include paths to the build settings in Xcode, I am getting the following errors:</p>
  
  <pre><code>&lt;unknown&gt;:0: error: module 'LLVM_Backend.CodeGen.PBQP.math' requires feature 'cplusplus'
  /Users/freddy/Development/llvm-source/build/include/llvm/Support/DataTypes.h:35:10: note: submodule of top-level module 'LLVM_Backend' implicitly imported here
  #include &lt;math.h&gt;
           ^
  &lt;module-includes&gt;:1:9: note: in file included from &lt;module-includes&gt;:1:
  #import "./Analysis.h"
          ^
  /Users/freddy/Development/llvm-source/llvm/include/llvm-c/./Analysis.h:22:10: note: in file included from /Users/freddy/Development/llvm-source/llvm/include/llvm-c/./Analysis.h:22:
  #include "llvm-c/Types.h"
           ^
  /Users/freddy/Development/llvm-source/llvm/include/llvm-c/Types.h:17:10: error: could not build module 'LLVM_Support_DataTypes'
  #include "llvm/Support/DataTypes.h"
           ^
  /Users/freddy/Development/Xcode Projects/SwiftLLVMTest/SwiftLLVMTest/main.swift:10:8: error: could not build Objective-C module 'LLVM_C'
  import LLVM_C
  </code></pre>
  
  <p>The next step in the slides is to add the flags:</p>
  
  <pre><code>-Xcc -D__STDC_CONSTANT_MACROS \
  -Xcc -D__STDC_LIMIT_MACROS
  </code></pre>
  
  <p>but I'm not sure where to put these in the build settings--adding them to the 'Other C Flags' or 'Other Swift Flags' options doesn't seem to do anything.</p>
  
  <p>How should I go about doing this?</p>