Multiplatform C++ cross-compiler

喜夏-厌秋 提交于 2020-01-02 03:59:06

问题


How can I build a cross-compiler for a C++ library to target many platforms on a single build server?

The cross-compiler should be able to build the library for (at least) {Windows 7, Mac OS X, Ubuntu 11.04} × {32 bit, 64 bit} × {Debug, Release}. I don't care if the whole build from scratch takes forever or if the gcc binary is 1 GB. If the cross-compiler cannot be a single executable, what is the workflow I should use to compile (and recompile) my library?

The host machine would be a Ubuntu 11.04.


回答1:


Building cross-compiler is quite well covered in OSDev Wiki. For Windows, you can use mingw packages in your distro's repository




回答2:


Windows host + TeamCity + GCC (mingw) + Gnu Make (or complementary build script solution) + MSVC8/9

You can have teamcity automate the building of everything for you, GCC will let you build targets in all DBG/REL, 32/64 bit, MacOS/Linux permutations. MSVC8/9 test for cross-compiler compatibilities.



来源:https://stackoverflow.com/questions/5980397/multiplatform-c-cross-compiler

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