Have Gradle observe LDFLAGS/CXXFLAGS/CPPFLAGS

This allows building with a private proto installation (one in home
directory or elsewhere) by specifying -I and -L.
This commit is contained in:
Eric Anderson 2015-01-29 12:41:51 -08:00
parent 0f1e24a7ea
commit 2049e0d618
1 changed files with 9 additions and 0 deletions

View File

@ -9,7 +9,16 @@ executables {
binaries.all { binaries.all {
if (toolChain in Gcc) { if (toolChain in Gcc) {
cppCompiler.args "-std=c++11" cppCompiler.args "-std=c++11"
if (System.env.CXXFLAGS) {
cppCompiler.args System.env.CXXFLAGS
}
if (System.env.CPPFLAGS) {
cppCompiler.args System.env.CPPFLAGS
}
linker.args "-lprotoc", "-lprotobuf" linker.args "-lprotoc", "-lprotobuf"
if (System.env.LDFLAGS) {
linker.args System.env.LDFLAGS
}
} }
} }