From 2049e0d6184292fb93dc9fa88a0de6abfbc6b8ad Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Thu, 29 Jan 2015 12:41:51 -0800 Subject: [PATCH] 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. --- compiler/build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/build.gradle b/compiler/build.gradle index 2093b9d8e2..acfd0f5e9e 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -9,7 +9,16 @@ executables { binaries.all { if (toolChain in Gcc) { 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" + if (System.env.LDFLAGS) { + linker.args System.env.LDFLAGS + } } }