diff options
author | Rui Abreu Ferreira <raf-ep@gmx.com> | 2014-06-25 18:50:17 +0100 |
---|---|---|
committer | Florian Walch <florian@fwalch.com> | 2015-05-15 17:55:02 +0300 |
commit | f65614fb1cb9fc668779819f05d884f70ffe2aeb (patch) | |
tree | 31e25ac6381a57d64c56372da5a5b21a02c00a7d | |
parent | cca32e64cc897830bc0419c01413492748353a0b (diff) | |
download | rneovim-f65614fb1cb9fc668779819f05d884f70ffe2aeb.tar.gz rneovim-f65614fb1cb9fc668779819f05d884f70ffe2aeb.tar.bz2 rneovim-f65614fb1cb9fc668779819f05d884f70ffe2aeb.zip |
Travis: Add Mingw third-party builds
- Build third-party/ in Travis using mingw
- Import mingw-w64 cmake toolchain
-rw-r--r-- | .ci/mingw.sh | 18 | ||||
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | cmake/mingw32-w64-cross-travis.toolchain.cmake | 53 |
3 files changed, 72 insertions, 0 deletions
diff --git a/.ci/mingw.sh b/.ci/mingw.sh new file mode 100644 index 0000000000..e1372cecc9 --- /dev/null +++ b/.ci/mingw.sh @@ -0,0 +1,18 @@ +. "$CI_SCRIPTS/common.sh" + +# FIXME: When Travis gets a recent version of Mingw-w64 use this +#sudo apt-get install binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-dev mingw-w64-tools +#sudo apt-get install wine +sudo apt-get install libc6-dev-i386 + +# mingw-w64 build from http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-release/ +wget "http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-release/i686-w64-mingw32-gcc-4.8.0-linux64_rubenvb.tar.xz" -O mingw.tar.xz +sudo tar -axf mingw.tar.xz -C /opt +export PATH=$PATH:/opt/mingw32/bin + +# Build third-party +mkdir .deps +cd .deps +cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw32-w64-cross-travis.toolchain.cmake ../third-party/ +cmake --build . +cd .. diff --git a/.travis.yml b/.travis.yml index 34df160ba0..fb4c69c21b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,7 @@ env: - CI_TARGET=gcc - CI_TARGET=gcc-32 - CI_TARGET=clint + - CI_TARGET=mingw matrix: include: - os: osx diff --git a/cmake/mingw32-w64-cross-travis.toolchain.cmake b/cmake/mingw32-w64-cross-travis.toolchain.cmake new file mode 100644 index 0000000000..bdd14365c6 --- /dev/null +++ b/cmake/mingw32-w64-cross-travis.toolchain.cmake @@ -0,0 +1,53 @@ +# +# Mingw-w64 cross compiler toolchain +# +# - The usual CMAKE variables will point to the cross compiler +# - HOST_EXE_LINKER, HOST_C_COMPILER, HOST_EXE_LINKER_FLAGS, +# HOST_C_FLAGS point to a host compiler +# + +set(MINGW_TRIPLET i686-w64-mingw32) +# For x86_64 use +#set(MINGW_TRIPLET x86_64-w64-mingw32) + +# The location of your toolchain sys-root +set(MINGW_PREFIX_PATH /opt/mingw32/${MINGW_TRIPLET}/) +# or sometimes like this +#set(MINGW_PREFIX_PATH /usr/${MINGW_TRIPLET}/sys-root) + +# the name of the target operating system +set(CMAKE_SYSTEM_NAME Windows) + +# which compilers to use for C and C++ +set(CMAKE_C_COMPILER ${MINGW_TRIPLET}-gcc) +set(CMAKE_CXX_COMPILER ${MINGW_TRIPLET}-g++) +set(CMAKE_RC_COMPILER ${MINGW_TRIPLET}-windres) +set(CMAKE_C_COMPILER ${MINGW_TRIPLET}-gcc) +set(CMAKE_CXX_COMPILER ${MINGW_TRIPLET}-g++) +set(CMAKE_RC_COMPILER ${MINGW_TRIPLET}-windres) + +# Where is the target environment located +set(CMAKE_FIND_ROOT_PATH "${MINGW_PREFIX_PATH}/mingw") + +# adjust the default behaviour of the FIND_XXX() commands: +# search headers and libraries in the target environment, search +# programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +set(CROSS_TARGET ${MINGW_TRIPLET}) + +# We need a host compiler too - assuming mildly sane Unix +# defaults here +set(HOST_C_COMPILER cc) +set(HOST_EXE_LINKER ld) + +if (MINGW_TRIPLET MATCHES "^x86_64") + set(HOST_C_FLAGS) + set(HOST_EXE_LINKER_FLAGS) +else() + # In 32 bits systems have the HOST compiler generate 32 bits binaries + set(HOST_C_FLAGS -m32) + set(HOST_EXE_LINKER_FLAGS -m32) +endif() |