mirror of
https://github.com/ysoftdevs/cpp-examples.git
synced 2026-01-11 22:40:49 +01:00
add C++ example of build by Gradle
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1,3 @@
|
||||
.DS_Store
|
||||
.gradle
|
||||
**/build/
|
||||
|
||||
16
README.md
16
README.md
@@ -68,6 +68,22 @@ How to run:
|
||||
make
|
||||
./helloworld
|
||||
|
||||
Gradle
|
||||
------
|
||||
|
||||
Example of building C/C++ project by Gradle.
|
||||
Gradle is using build.gradle file in main project directory.
|
||||
Check out project layout. Source code is stored in src/main/cpp.
|
||||
This is defined by convention and Gradle is able to use it, no further configuration is needed.
|
||||
Gradle is able to determine compiler chain and use available compiler, e.g. g++ or Visual Studio.
|
||||
|
||||
How to run (Linux):
|
||||
|
||||
cd gradle/hellomuni
|
||||
gradle mainExecutable
|
||||
cd build/binaries/mainExecutable
|
||||
./hellomuni
|
||||
|
||||
Minunit testing
|
||||
---------------
|
||||
|
||||
|
||||
1
gradle/hellomuni/build.gradle
Normal file
1
gradle/hellomuni/build.gradle
Normal file
@@ -0,0 +1 @@
|
||||
apply plugin: 'cpp-exe'
|
||||
9
gradle/hellomuni/src/main/cpp/hellomuni.cpp
Normal file
9
gradle/hellomuni/src/main/cpp/hellomuni.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
cout << "Hello FI MUNI!" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user