Over the weekend I've played with continuous integration for Gammu to make it run on more platforms. I had to remember many things from the Windows world on the way and the solution is not yet complete, but the basic build is working, the only problematic part are external dependencies.
First of all we already have Linux builds on Travis CI. These cover compilation with both GCC and Clang compilers, hopefully covering most of the possible problems.
Recently I've added OS X builds on Travis CI, what was pretty much painless and worked out of the box.
The next major architecture to support is Windows. Once I've discovered AppVeyor I thought it might be the way to go. The have free plans for open-source projects (though it has only one parallel build compared to four provided by Travis CI).
As our build system is cross platform based on CMake, it should work pretty much out of the box, right? Well almost, tweaking the basics took some time (unfortunately there is no CMake support on AppVeyor, so you have to script it a bit).
The most painful things on the way:
- finding our correct way to invoke build and testsuite
- our code was broken on Windows, making the testsuite to fail
- how to work with power shell (no, I'm not going to like it)
- how to download and install executable to PATH
- test output integration with AppVeyor - done using XSLT transformation and uploading test results manually
- 32-bit / 64-bit mess, CMake happily finds 32-bit libs during the 64-bit build and vice versa, what makes the build fail later when linking - fixed by trying if code can be built with given library
- 64-bit code crashes in dummy driver, causing testsuite failures (this has to be something Windows specific as the code works fine on 64-bit Linux) - this seems to be caused by too big allocations on stack, moving them to heap will fix this
As a nice side effect, we now have up to date Windows binaries for Gammu.