Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

build C++ projects in Maven with maven-nar-plugin

has anyone using maven-nar-plugin to build C++ code for different platforms, using different compilers? If there is someone please give me more info regarding this. I am just wondering how can be a NAR file built for different platforms with maven. I know that in order to be able to build a project on a specific platform you should run the build on that platform, and use the specific compilers and linkers of that platform. But my experience is related to Java projects and Maven and as you already know java is pretty platform portable so I've not experienced problems like thin until now. So, any help and details about how to build projects with maven-nar-plugin would be appreaciated! Thanks

like image 269
Asgard Avatar asked Nov 04 '22 21:11

Asgard


1 Answers

Currently, the most surefire way to build multiple platform binaries with maven-nar-plugin is to actually do it on different platforms, rather than attempting a cross-compilation-based solution.

For example, the ImageJ project uses maven-nar-plugin to build a small native launcher for Linux, OS X and Windows, 32-bit and 64-bit versions.

To accomplish this, the project has a Jenkins CIS on a Linux server, a Windows 7 64-bit VM in VirtualBox with a Jenkins slave, and an OS X desktop Jenkins slave, each of which performs the Maven build for its respective platforms.

It was quite involved to set up; there are detailed instructions in this ticket of the ImageJ issue tracker.

On a related note, a group of interested developers have recently resurrected maven-nar-plugin, migrating the official repository to a new maven-nar organization. One of the items of interest is cross-compilation, which would make it easier to build native binaries for multiple AOLs on the same platform without resorting to Jenkins slaves. But there are many challenges (e.g., GCC changes behavior often), and it is not yet easy to do. We invite interested developers to join the discussion on the new maven-nar-plugin mailing list!

like image 197
ctrueden Avatar answered Nov 08 '22 04:11

ctrueden