2

Gradle 1.7 came out recently with some inspiring support for C++.

I have built and compiled my project in my arch linux box using g++ and it worked great! The build.gradle is this simple:

apply plugin: "cpp-exe"

binaries.all {
    if (toolChain == toolChains.gcc) {
        compilerArgs "-std=c++11"
        linkerArgs "-lboost_program_options"
    }
}

defaultTasks "mainExecutable"

Now I'm trying to build it on my MacOs, but there gradle tries to run it with g++ which doesn't support the -std=c++11 (remember, mac's g++ version is 4.2.1).

Is there a way to tell gradle to use clang++ ? I'm happy to add another if statement to the build.gradle if that's possible.

Carneiro
  • 3,479
  • 5
  • 24
  • 36

1 Answers1

1

1.7 ships with support for g++ and Visual C++. You can file a feature request at http://forums.gradle.org.

Peter Niederwieser
  • 121,412
  • 21
  • 324
  • 259