title: How do I set a Preprocessor Definition in Gradle
body: <p>I apologize if this is a duplicate, but how do I define a preprocessor definition.  In Visual Studio I can just go to C++ -> Preprocessor and set a list of definitions there.  But I'm struggling with that in my Android gradle build.</p>
  
  <p>I need to define DEBUG, as to satisfy the following condition</p>
  
  <pre><code>#if (!defined(NDEBUG)) &amp;&amp; (!defined(DEBUG))
  </code></pre>
  
  <p>I've tried adding -DDEBUG, but that didn't seem to work.  I've struggled finding documentation on what needs to be done.</p>
  
  <pre><code>    cppFlags.addAll(["-fexceptions", "-std=gnu++11", "-DDEBUG"])
  </code></pre>
  
  <p>Here is my NDK build block
          // defines the NDK build
          ndk {
              moduleName "mymodule"</p>
  
  <pre><code>        toolchain = "clang"
  
          // If switching to GNU, here are the values to replace with
          stl "gnustl_shared"
          cppFlags.addAll(["-fexceptions", "-std=gnu++11", "-DDEBUG"])
  
  
          // when adding system library dependencies, they are added here
          ldLibs.addAll(["log","atomic"])
  
          // C include directories
          CFlags.addAll(["-I${file("src/main/jni/folder1")}".toString(),
                         "-I${file("src/main/jni/folder2")}".toString()
          ])
  
          // C++ include directories
          cppFlags.addAll(["-I${file("src/main/jni/morestuff")}".toString(),
          ])
      }
  </code></pre>