title: How do I compile a C++ file to WebAssembly?
body: <p>Suppose I have a simple, self-contained C++ file (<code>math.cpp</code>) like this: </p>
  
  <pre><code>int add(int x, int y) {
    return x + y;
  }
  </code></pre>
  
  <p>How would I compile it to WebAssembly (<code>math.wasm</code>)?</p>
  
  <p>Note: I am using the Clang tool-chain. </p>