apply plugin: 'cpp' // Based on http://www.gradle.org/docs/current/userguide/nativeBinaries.html binaries.all { if (toolChain in Gcc && buildType == buildTypes.debug) { cppCompiler.args "-g" } if (toolChain in VisualCpp && buildType == buildTypes.debug) { cppCompiler.args '/Zi' cppCompiler.define 'DEBUG' linker.args '/DEBUG' } } executables { main { } }