Cross compile Go on OSX?

With Go 1.5 they seem to have improved the cross compilation process, meaning it is built in now. No ./make.bash-ing or brew-ing required. The process is described here but for the TLDR-ers (like me) out there: you just set the GOOS and the GOARCH environment variables and run the go build. For the even lazier … Read more

Embed resources (eg, shader code; images) into executable/library with CMake

As an alternative to the answer of sfstewman, here’s a small cmake (2.8) function to convert all files in a specific folder to C data and write them in wished output file: # Creates C resources file from files in given directory function(create_resources dir output) # Create empty output file file(WRITE ${output} “”) # Collect … Read more

How do I configure Qt for cross-compilation from Linux to Windows target?

Just use M cross environment (MXE). It takes the pain out of the whole process: Get it: $ git clone https://github.com/mxe/mxe.git Install build dependencies Build Qt for Windows, its dependencies, and the cross-build tools; this will take about an hour on a fast machine with decent internet access; the download is about 500MB: $ cd … Read more

How to cross compile from Mac OS X to Linux x86?

Your simplest solution is to just run CentOS 5.3 in a VM (e.g. Sun VirtualBox). This requires minimal setup, has quite reasonable overhead (assuming an Intel Mac), and you’ll be able to actually test and debug what you are building. If you really insist on cross-compiling, you must build a cross-compiler. Instructions are here and … Read more

How to stop MinGW and MSYS from mangling path names given at the command line

There is a way to suppress the path translation by setting MSYS_NO_PATHCONV=1 in Windows Git MSys or MSYS2_ARG_CONV_EXCL=”*” in MSYS2. Alternatively, you can set the variable only temporarily just for that command by putting the assignment just before the command itself: MSYS_NO_PATHCONV=1 arm-none-linux-gnueabi-gcc.exe -Wall -g \ -Wl,–dynamic-linker=/usr/lib/myrpath/ld-linux.so.3 \ -Wl,-rpath=/usr/lib/myrpath \ -I../targetsysroot/usr/include \ myprogram.c -o myprogram

What’s the difference of “./configure” option “–build”, “–host” and “–target”?

As noted in this blog post and alluded to in the GCC Configure Terms, –target only applies when you are compiling toolchains. When you are doing normal cross-compilation of a library or binary you use –build=the architecture of the build machine –host=the architecture that you want the file to run on However, when you are … Read more