2017-10-19 07:55:15 +00:00
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
#Open Asset Import Library (assimp)
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
# Copyright (c) 2006-2017, assimp team
|
|
|
|
#
|
|
|
|
# License see LICENSE file
|
|
|
|
#
|
2017-11-03 12:11:30 +00:00
|
|
|
function generate() {
|
2017-10-07 11:47:52 +00:00
|
|
|
OPTIONS="-DASSIMP_WERROR=ON"
|
|
|
|
|
2017-10-07 12:37:45 +00:00
|
|
|
if [ "$DISABLE_EXPORTERS" = "YES" ] ; then
|
2017-10-07 11:47:52 +00:00
|
|
|
OPTIONS="$OPTIONS -DASSIMP_NO_EXPORT=YES"
|
|
|
|
else
|
|
|
|
OPTIONS="$OPTIONS -DASSIMP_NO_EXPORT=NO"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$SHARED_BUILD" = "ON" ] ; then
|
|
|
|
OPTIONS="$OPTIONS -DBUILD_SHARED_LIBS=ON"
|
|
|
|
else
|
|
|
|
OPTIONS="$OPTIONS -DBUILD_SHARED_LIBS=OFF"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$ENABLE_COVERALLS" = "ON" ] ; then
|
|
|
|
OPTIONS="$OPTIONS -DASSIMP_COVERALLS=ON"
|
|
|
|
else
|
|
|
|
OPTIONS="$OPTIONS -DASSIMP_COVERALLS=OFF"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$ASAN" = "ON" ] ; then
|
|
|
|
OPTIONS="$OPTIONS -DASSIMP_ASAN=ON"
|
|
|
|
else
|
|
|
|
OPTIONS="$OPTIONS -DASSIMP_ASAN=OFF"
|
|
|
|
fi
|
|
|
|
|
2017-10-07 14:47:06 +00:00
|
|
|
if [ "$UBSAN" = "ON" ] ; then
|
|
|
|
OPTIONS="$OPTIONS -DASSIMP_UBSAN=ON"
|
|
|
|
fi
|
|
|
|
|
2017-10-07 11:47:52 +00:00
|
|
|
cmake -G "Unix Makefiles" $OPTIONS
|
2015-06-30 04:35:31 +00:00
|
|
|
}
|
2017-10-19 07:43:56 +00:00
|
|
|
# build and run unittests, if not android
|
2015-12-20 19:23:16 +00:00
|
|
|
if [ $ANDROID ]; then
|
2015-06-30 04:35:31 +00:00
|
|
|
ant -v -Dmy.dir=${TRAVIS_BUILD_DIR} -f ${TRAVIS_BUILD_DIR}/port/jassimp/build.xml ndk-jni
|
2017-06-07 08:30:40 +00:00
|
|
|
fi
|
2017-06-07 09:48:00 +00:00
|
|
|
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
2017-10-17 15:37:40 +00:00
|
|
|
if [ $ANALYZE = "ON" ] ; then
|
|
|
|
if [ "$CC" = "clang" ]; then
|
2017-10-17 16:29:54 +00:00
|
|
|
scan-build cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=OFF -DASSIMP_BUILD_TESTS=OFF
|
2017-10-17 15:37:40 +00:00
|
|
|
scan-build --status-bugs make -j2
|
|
|
|
else
|
|
|
|
cppcheck --version
|
|
|
|
generate \
|
|
|
|
&& cppcheck --error-exitcode=1 -j2 -Iinclude -Icode code 2> cppcheck.txt
|
|
|
|
if [ -s cppcheck.txt ]; then
|
|
|
|
cat cppcheck.txt
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
2015-06-30 04:35:31 +00:00
|
|
|
generate \
|
2016-11-10 09:33:07 +00:00
|
|
|
&& make -j4 \
|
2015-06-30 04:35:31 +00:00
|
|
|
&& sudo make install \
|
|
|
|
&& sudo ldconfig \
|
2017-10-19 07:43:56 +00:00
|
|
|
&& (cd test/unit; ../../bin/unit)
|
2017-10-17 15:37:40 +00:00
|
|
|
fi
|
2015-06-30 04:35:31 +00:00
|
|
|
fi
|