Travis CI config file & related required changes
This commit is contained in:
parent
12c1583ecf
commit
484c5f7241
8
.travis.yml
Normal file
8
.travis.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
language: cpp
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
- clang
|
||||||
|
script: ./install.sh
|
||||||
|
env:
|
||||||
|
- YCM_TESTRUN=1 EXTRA_CMAKE_ARGS=""
|
||||||
|
- YCM_TESTRUN=1 EXTRA_CMAKE_ARGS="-DUSE_CLANG_COMPLETER=ON"
|
@ -41,8 +41,12 @@ endif()
|
|||||||
|
|
||||||
if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
|
if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
|
||||||
set( COMPILER_IS_CLANG true )
|
set( COMPILER_IS_CLANG true )
|
||||||
|
|
||||||
|
# The Travis CI build machines don't have libc++ installed
|
||||||
|
if ( NOT DEFINED ENV{TRAVIS} )
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if ( CMAKE_GENERATOR STREQUAL Xcode )
|
if ( CMAKE_GENERATOR STREQUAL Xcode )
|
||||||
set( CMAKE_GENERATOR_IS_XCODE true )
|
set( CMAKE_GENERATOR_IS_XCODE true )
|
||||||
|
22
install.sh
22
install.sh
@ -82,6 +82,20 @@ function install {
|
|||||||
rm -rf $build_dir
|
rm -rf $build_dir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testrun {
|
||||||
|
ycm_dir=`pwd`
|
||||||
|
build_dir=`mktemp -d -t ycm_build.XXXXXX`
|
||||||
|
pushd $build_dir
|
||||||
|
|
||||||
|
cmake -G "Unix Makefiles" $1 . $ycm_dir/cpp
|
||||||
|
make -j $(num_cores) ycm_core_tests
|
||||||
|
cd ycm/tests
|
||||||
|
LD_LIBRARY_PATH=$ycm_dir/python ./ycm_core_tests
|
||||||
|
|
||||||
|
popd
|
||||||
|
rm -rf $build_dir
|
||||||
|
}
|
||||||
|
|
||||||
function linux_cmake_install {
|
function linux_cmake_install {
|
||||||
echo "Please install CMake using your package manager and retry."
|
echo "Please install CMake using your package manager and retry."
|
||||||
exit 1
|
exit 1
|
||||||
@ -112,4 +126,10 @@ if ! command_exists cmake; then
|
|||||||
echo "CMake is required to build YouCompleteMe."
|
echo "CMake is required to build YouCompleteMe."
|
||||||
cmake_install
|
cmake_install
|
||||||
fi
|
fi
|
||||||
install $cmake_args
|
|
||||||
|
if [ -z "$YCM_TESTRUN" ]; then
|
||||||
|
install $cmake_args $EXTRA_CMAKE_ARGS
|
||||||
|
else
|
||||||
|
testrun $cmake_args $EXTRA_CMAKE_ARGS
|
||||||
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user