Alex C
Alex C

Reputation: 217

C++ eclipse project automatic build server

I am building an embedded C++ project with eclipse. I want to set-up a continuous integration system where a build server would compile and run unit tests each time a commit is made to the github repo.

My problem is that the C++ project uses eclipse for development and I don't know how to automate a build with a .cproject/.project the same way you would do it with a makefile and a CI framework like TravisCI or Jenkins.

I thought I about maybe using the "generate makefile" feature but I don't want to have to regenerate a new makefile each time I make a change on a .project or .cproject file.

Anyone have any suggestions?

Upvotes: 2

Views: 1339

Answers (2)

Alex C
Alex C

Reputation: 217

After some research, I think the best approach is to use what is called a headless build. It takes the .project and .cproject and compiles it.

$ eclipse \
--launcher.suppressErrors \
-nosplash \
-application org.eclipse.cdt.managedbuilder.core.headlessbuild \
-data /path/to/workspace \
-cleanBuild "project/configuration"

The result of the above command is a clean build of the given project configuration from the given workspace.

http://gnuarmeclipse.github.io/advanced/headless-builds/

Upvotes: 5

πάντα ῥεῖ
πάντα ῥεῖ

Reputation: 1

You can rather use a custom Makefile project, than letting Eclipse building a Makefile for you.

You'll need to invest some time to develop a generic build system, that auto detects source files to be included to your build and handles all of their dependencies.

Upvotes: 0

Related Questions