The plugin provides basic build tuning according to the current profile (Debug/Release) and used toolchain. Also, some customization is available via the plugin configuration section.
The cpp-build-tuner require to work another Gradle core plugins: cpp-application/cpp-library/cpp-unit-test.
plugins {
id 'cpp-library'
id 'cpp-unit-test'
id 'loggersoft.cpp-build-tuner' version '1.1'
}
MSVC and GCC compatible toolchains.
The plugin tries to reduce build time for the Debug variant and save maximum information for debugging. In opposite, for Release variant debug information is disabled and maximum speed optimizations (include link-time optimizations) are enabled.
buildTuner {
lto = false
gtest = '1.8.1'
libraries {
common = ['cutils.lib']
windows = ['ole32', 'user32']
linux = ['pthread', 'z']
}
libDirs.common = ['../build/debug', '../release']
}
The plugin provides an extension for cpp-application which allow running application via Gradle (like as Java Application plugin).
For application projects, a plugin adds tasks: run, runDebug (same as run) and runRelease. Those tasks depend on assemble, assembleDebug and assembleRelease correspondently.
Also, you can pass command-line arguments as in Java Application plugin:
gradle run --args="arg1 arg2 ..."