55# Since CMake is not directly supported we use erlang VMs
66language : erlang
77
8- # Try using multiple Lua Implementations
98env :
10- - LUA="" # Use automatic dependencies
11- - LUA="luajit" # Try with LuaJIT
12- # - CMAKE="-DCMAKE_VARIABLE=value"
13- # - LUA="lua-5.1.5"
14-
15- # Allow luajit to fail
16- matrix :
17- allow_failures :
18- - env : LUA="luajit"
19-
20- # We need CMake and LuaDist
9+ - TOOL=""
10+ - TOOL="i686-w64-mingw32-" # 32-bit mingw
11+ - TOOL="x86_64-w64-mingw32-" # 64-bit mingw
12+ - TOOL="arm-linux-gnueabihf-" # ARM hard-float (hf), linux
13+ - COMPILER="clang" # clang
14+ # - TOOL="i586-mingw32msvc-" # old 32-bit mingw
15+
16+ # We need CMake and toolchains.
2117install :
22- - export MODULE=`basename $PWD`
23- - sudo apt-get install cmake >/dev/null 2>&1
24- - git clone git://github.com/LuaDist/bootstrap.git _luadist >/dev/null 2>&1
25- - cd _luadist
26- - git submodule update --init >/dev/null 2>&1
27- - ./bootstrap >/dev/null 2>&1
28- - export LUADIST=$PWD/_install/bin/luadist
29- - cd $HOME
30-
31- # Use LuaDist to deploy the module
18+ - sudo apt-get -qq install cmake
19+ - if [ "$TOOL" == "i586-mingw32msvc-" ]; then sudo apt-get -qq install gcc-mingw32; fi
20+ - if [ "$TOOL" == "x86_64-w64-mingw32-" -o "$TOOL" == "i686-w64-mingw32-" ]; then sudo apt-get -qq install gcc-mingw-w64; fi
21+ - if [ "$TOOL" == "arm-linux-gnueabihf-" ]; then sudo apt-get -qq install gcc-arm-linux-gnueabihf; fi
22+ - if [ "$COMPILER" == "clang" ]; then sudo apt-get -qq install clang; export CC=clang; fi
23+ - export TOOLFILE="$HOME/$TOOL.cmake"
24+ - echo '' > $TOOLFILE
25+ - echo "set(_toolchain $TOOL)" >> $TOOLFILE
26+ - if [ "$TOOL" == "arm-linux-gnueabihf-" ]; then export SYSTEM="Linux"; else export SYSTEM="Windows"; fi
27+ - echo "set(CMAKE_SYSTEM_NAME $SYSTEM)" >> $TOOLFILE
28+ - echo 'set(CMAKE_C_COMPILER ${_toolchain}gcc)' >> $TOOLFILE
29+ - echo 'set(CMAKE_CXX_COMPILER ${_toolchain}g++)' >> $TOOLFILE
30+ - echo 'set(CMAKE_RC_COMPILER ${_toolchain}windres )' >> $TOOLFILE
31+ - echo 'set(CMAKE_RC_OUTPUT_EXTENSION .obj)' >> $TOOLFILE
32+ - echo 'set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>")' >> $TOOLFILE
33+ - echo 'set(CMAKE_FIND_ROOT_PATH /usr/${_toolchain}/ ${CMAKE_INSTALL_PREFIX})' >> $TOOLFILE
34+ - echo 'set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)' >> $TOOLFILE
35+ - echo 'set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)' >> $TOOLFILE
36+
37+
38+ # Use CMake to build module.
3239script :
33- - $LUADIST _test install $LUA $MODULE-scm $CMAKE -verbose=true -test=true
34-
35- # Execute additional tests or commands
36- # after_script:
37- # - [run additional test commans]
40+ - mkdir _build _install && cd _build
41+ - if [ $TOOL ]; then export TOOLARG="-DCMAKE_TOOLCHAIN_FILE=$TOOLFILE"; fi
42+ - cmake $TOOLARG -DCMAKE_INSTALL_PREFIX=../_install ..
43+ - make
44+ - if [ ! $TOOL ]; then make test; fi
45+ - make install
3846
3947# Only watch the master branch
4048branches :
@@ -47,4 +55,4 @@ notifications:
4755 - luadist-dev@googlegroups.com
4856 email :
4957 on_success : change
50- on_failure : always
58+ on_failure : always
0 commit comments