-
put this in build.gradle
apply plugin: 'cpp' executables { hello {} }
-
put your source file in src/hello/cpp/say_hello.cpp
-
run ‘gradle helloExecutable’
-
your executable should be built to build/binaries/helloExecutable/hello
Or, if you want your source in src/foo/bar then add
sources {
hello {
cpp {
source {
srcDir "src/foo/bar"
}
}
}