Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build tools for multiple mobile platforms

We have a complex C++ codebase targeting multiple mobile platforms. We currently have Windows CE (4.2 to 6.5 both raw CE and Mobile based on those), Android (2.1+), iPhone (4+), almost working Bada (2.0+) and if anything comes of the new C++/CX thing, are likely to add Windows Phone (8+). Plus a testing version on Win32 and service application on Win64 that shares some code. We also already tried to compile unit tests on Linux and questions already came (too small business volume so far, but that might change) to get it working on some other Linux platforms.

We currently compile the code with native tools for each platform. Each of them is pretty complex and has some hacks in or around it to achieve reasonably single-click builds. And for Bada, we didn't solve builds outside of the Samsung-tweaked Eclipse yet, which we'll have to do for production.

So far it works, but is becoming more and more of a maintenance problem. The biggest problem currently is the iPhone build, because unlike Visual Studio project files and plain makefiles, it's not possible to add/remove/rename files in XCode project by hand and only two people have MacOS boxen and any experience with XCode (while everybody has Windows and knows Visual Studio). We also need to create some makefiles for the Bada target (it's plain GNU toolchain, so anything capable of cross-compiling with those should do) and I wouldn't mid getting rid of some of the kludges in Android build: fix for bug in dependency handling when building under cygwin, some hacks on top of the ant build script and shell glue to massage manifest and hold it all together.

So I am looking for advice on ways to unify the build process for this set of diverse platforms.

  • It absolutely has to handle building the iPhone and Bada executables and the native part of the Android build (because nobody has all three platforms to test separately).
  • Has to handle large project consisting of several shared libraries, one main binary, one test binary for the same platforms and some auxiliary binaries built only on some platforms (well, currently Win32 only).
  • Has to be able to generate build configuration header and Java file with version from version control system and some user-defied variables, since we do 18 and counting slightly different builds for various customers.
  • And of course it has to automatically handle dependencies (header files) and generally be reliable.

For the other things I am prepared to hack around any deficiencies, but I would obviously like to keep the amount of shell duct tape and spit to minimum, so it should:

  • Be able to integrate with Visual Studio, Eclipse and XCode enough that each environment can trigger build, upload the build product to the respective target and attach debugger to it there.
  • Be able to build Java and call the custom packaging tools for Android, so we don't have to hack around the ant build script that Google gratuitously and incompatibly changed twice in last two years already (and old SDK can't be downloaded).
  • Be able to install various data files and call random packagers and random other scripts and tools and stuff, so it does not have to be mixed with too much shell script.

We have so far started trying CMake (didn't have much time, so didn't get far, but will have to do something shortly) and also thought about SCons. However I have already tried building with SCons for Windows CE a few years ago, but since it generates makefile-type projects for Visual Studio and those didn't work for embedded platforms in VS2005, I gave up. CMake can generate native makefiles, but a custom, bit out of date, branch is needed for CE. So I'd like to ask whether there are any other tools we might want to look into or any known stumbling blocks with these tools we should be aware of.

Updates: I've found instructions for android native binaries in several places and pixellight even has cmake script to generate apk by directly calling the packaging tools. Also this shell script shows it. iPhone usage seems to be documented here.

like image 936
Jan Hudec Avatar asked Mar 28 '12 14:03

Jan Hudec


People also ask

What program can run on multiple platforms?

Cross-platform software may run on many platforms, or as few as two. Some frameworks for cross-platform development are Codename One, Kivy, Qt, Flutter, NativeScript, Xamarin, Phonegap, Ionic, and React Native.

Which is a mobile app creator for different platforms?

Adobe PhoneGap This platform is widely known for its use in Android development. The benefit of using PhoneGap is that you can develop a single app that can work on all mobile devices. Moreover, it is an open-source desktop application, and you can link the apps to mobile devices.


2 Answers

The same CMake build files can be used to generate and build projects across platforms for atleast Win32 (VS2005), Linux(ubuntu), and OS X (10.5.8 Leopard), in my personal experince. There are multiple projects for using CMake in the android app build process, eg http://code.google.com/p/android-cmake/. With all these options, I would consider CMake a good option. Further CMake is easy to pick up, and even easier if you have prior experience with writing configure.ac and Makefile.ac files.

Note: How CMake works:

  1. Developer/Maintainer creates CMakefile.
  2. Builder runs cmake, which uses the CMakefile to generate platform specific build files.(linux makefiles/OSX makefiles/VS project files)
  3. Builder fires off the build command.
like image 154
Samveen Avatar answered Sep 19 '22 22:09

Samveen


CMake is the best choise. Starting with CMake 2.8.11 Windows CE is supported out of the box. Until the release of that version a ​Nightly Binary of CMake can be used.

like image 20
Aleksei Avatar answered Sep 16 '22 22:09

Aleksei