On Thu, Mar 6, 2014 at 12:37 PM, Xavier Ducrohet <x...@google.com> wrote:

> From the example in the docs:
>
> model {
>     toolChains {
>         gcc(Gcc) {
>             // Uncomment to use a GCC install that is not in the PATH
>             // path "/usr/bin/gcc"
>         }
>     }
> }
>
>
> and the DSL documentation, it seems the only configuration for a GCC
> toolchain is the "path".
>
> I've tried to use it but it seems like it always revert to my install GCC
> that's present in the path.
>
> Looking at the info output it shows:
>
> Starting process 'command '/usr/bin/g++''. Working directory: /usr/bin
> Command: /usr/bin/g++ -dM -E -
> Successfully started process 'command '/usr/bin/g++''
> Found C++ compiler with version 4
>
>
Yes, this is likely Gradle executing the compiler to get the version string.

>
> But it doesn't show the same for my custom toolchain, so it seems like
> it's not even trying to use it.
>

If you actually try to build something, you should get a message describing
why the tool chain is not available. Are you not seeing that?
Perhaps just define an executable with a windows platform, and see what
gets reported.


>
> One thing though is that my custom toolchain doesn't have a g++ entry in
> its "bin" folder. Instead it has "i686-linux-g++". Is this the source of
> the problem?
>

Very likely.


>
> The Gcc class has properties for the c/c++ compiler, linker, etc... but
> those are read only so I can't customize them.
>

What version of Gradle are you using? These properties are indeed
read-only, but they are configurable objects of type 'GccTool':
http://www.gradle.org/docs/nightly/dsl/org.gradle.nativebinaries.toolchain.Gcc.html#org.gradle.nativebinaries.toolchain.Gcc:cCompiler

Daz

Reply via email to