Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
140 views
in Technique[技术] by (71.8m points)

codeblocks - Code::Blocks build from bash

I'm developing a C++ application in Code::Blocks. My program has a few dependencies and has to run under Linux and Windows, this is why I use Code::Blocks.

Now I'd like to include Travis CI for testing the builds. On the Travis server, where I have no X11, I won't be able to run Code::Blocks. How can I build my project without Code::Blocks. (Is there a possibility to create "a Makefile" out of the .cbp-file?

This page (Code::Blocks Wiki) mentions there is a --build flag, but you need Code::Blocks & X11. Is there a server way without X11?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can not run anything which require X11 on Travis, and as far as I know, there is no way to launch a build using Code::Blocks without requiring X11.

The best choice would be to set up your project differently, for example using a Makefile. You will be able to configure Code::Blocks to use your Makefile and also to build on Travis using the make command.

You can also consider using CMake (especially if you are not familiar with Makefile syntax, but not only). This will let you configure your project in a more high level way (compared to a Makefile), and then you will be able to generate a Makefile or a project for the IDE of your choice.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...