C++ eclipse project automatic build server

感情迁移 提交于 2020-01-14 03:36:09

问题


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?


回答1:


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/




回答2:


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.



来源:https://stackoverflow.com/questions/34598087/c-eclipse-project-automatic-build-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!