[vlc-devel] [PATCH] Enhance cmake based contribs cross-compilation

Olivier Gambier olivier at webitup.fr
Wed Jan 25 02:02:50 CET 2012


If I understand correctly, we are able to cross-compile cmake based contribs only for windows and osx targets - because we don't specify a CMAKE_SYSTEM_NAME for anything else (in main.mak).
Actually, this fact does prevent from building correctly at least taglib and musepack from OSX to Linux (compilation partly works, but it fails linking due to cmake thinking this is a native build and trying to use system tools).

It seems the needed fix is just to specify explicitly  a CMAKE_SYSTEM_NAME in the toolchain file (http://www.vtk.org/Wiki/CMake_Cross_Compiling)

If that sounds ok, I would like to propose the attached patch.
It should alter the behavior ONLY when cross-compiling to a linux target.
But I guess that might alter things when targeting android, right? In that case, and if that wouldn't be desirable, I guess we could amend the patch to exclude android and keep the current state of affairs for that platform (whatever it is).

What do you think?

The patch is for the master.

Tested on OSX with:
- llvm-gcc-4.2
- i386-mingw32-4.3.0
- gcc-4.5.2-for-linux32
- gcc-4.5.2-for-linux64

Successfully compiling taglib and musepack for all four.

Best regards,

- Olivier

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Enhance-cmake-based-contribs-cross-compilation.patch
Type: application/octet-stream
Size: 844 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120125/641802f3/attachment.obj>

More information about the vlc-devel mailing list