简体   繁体   中英

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?

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/

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM