Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jarcode-foss/gcc-maven-plugin
a really simple maven plugin to compile C/C++ code with GCC
https://github.com/jarcode-foss/gcc-maven-plugin
Last synced: 4 days ago
JSON representation
a really simple maven plugin to compile C/C++ code with GCC
- Host: GitHub
- URL: https://github.com/jarcode-foss/gcc-maven-plugin
- Owner: jarcode-foss
- Created: 2015-10-31T00:08:32.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-31T08:54:14.000Z (about 9 years ago)
- Last Synced: 2023-03-24T14:42:04.937Z (over 1 year ago)
- Language: Java
- Size: 141 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gcc-maven-plugin
a really simple maven plugin to compile C/C++ code with GCCFeel free to use, modify, PR, whatever. I made this for my own maven projects that had JNI libraries.
You don't _nessecarily_ have to use GCC (there are settings to change flags/compilers), but all the default
settings are made for GCC. If you want to compile for multiple platforms, you will need to add multiple
executions.Example usage (excerpt from one of my own projects):
ca.jarcode
gcc-maven-plugin
1.4
compile-library
compile
compile
-O2 -Wall -D_REENTRANT -I${env.JAVA_HOME}/include -I${env.JAVA_HOME}/include/linux -Itarget/include -I/usr/include/luajit-2.0 -I/usr/include/luajit -fPIC
link-library
compile
link
-Lsrc/main/resources -lluajit-5.1 -lffi
true
libcomputerimpl.so
There are two goals in this plugin `link` and `compile`, which do exactly as they suggest. The `compile` goal passes the `-c` flag to gcc, and both flags will pass `-o` following the output file for the goal.
Sources are searched (recursively) in `src/main/c` by default, and their respective objects are compiled and stored in `target/objects`. Targets (executables and libraries) produced during the linking goal are placed in `target/natives`.
note: arguments are split on spaces, so adding arguments that point to directories with spaces could be difficult (string encapsulation is not parsed)
liscense: GPLv3