title: Passing the "-j" argument to ninja from gradle
body: <p>I need to pass <code>-j</code> argument to ninja while building Android app with gradle.
  (on Windows)</p>
  
  <p>Why do I need this?
  - We have huge unified c++ files that require lots of memory to compile. Currently I have no enough memory (~10GB free) to compile them in parallel on 8 cores. Thus clang fails when memory runs out.</p>
  
  <p>I see that gradle runs <code>cmake</code> with <code>--build</code> key so I've tried to add my <code>-j1</code> arg there. But seems <code>arguments</code> field is used only for cmake generation, because it doesn't affect command line passed to cmake in build stage.</p>
  
  <pre><code>externalNativeBuild {
      cmake {
          cFlags "..."
          cppFlags "..."
          arguments "... -- -j1"
      }
  }
  </code></pre>
  
  <p>The only way I see now it to replace <code>ninja</code> with some wrapper to pass <code>-j</code> from there. But this is the last options I would like to use.
  Appreciate any ideas about how to achieve this valid way.</p>