Fix travis build (again)

This commit is contained in:
nsubiron 2018-10-07 18:46:02 +02:00
parent 882992952c
commit 3b12d31cc6
4 changed files with 36 additions and 8 deletions

View File

@ -23,6 +23,8 @@ matrix:
- python3
- python3-pip
- libboost-python-dev
- libtiff5-dev
- libjpeg-dev
install:
- pip2 install -q --user setuptools nose2
- pip3 install -q --user setuptools nose2
@ -34,7 +36,7 @@ matrix:
- kill %1
- make check ARGS="--all --gtest_args=--gtest_filter=-*_mt"
after_failure:
- tail --lines=1000 build.log
- tail --lines=2000 build.log
- env: TEST="Pylint 2"
addons:

View File

@ -307,7 +307,19 @@ namespace detail {
struct tiff : detail::io_impl<detail::io_tiff> {};
struct any : detail::io_any<detail::io_png, detail::io_jpeg, detail::io_tiff> {};
#if LIBCARLA_IMAGE_WITH_PNG_SUPPORT
struct any : detail::io_any<detail::io_png, detail::io_tiff, detail::io_jpeg> {};
#elif LIBCARLA_IMAGE_WITH_TIFF_SUPPORT
struct any : detail::io_any<detail::io_tiff, detail::io_jpeg> {};
#else // Then for sure this one is available.
struct any : detail::io_any<detail::io_jpeg> {};
#endif
} // namespace io
} // namespace image

View File

@ -25,17 +25,23 @@ def get_libcarla_extensions():
extra_link_args = [
os.path.join(pwd, 'dependencies/lib/librpc.a'),
os.path.join(pwd, 'dependencies/lib/libboost_filesystem.a'),
os.path.join(pwd, 'dependencies/lib', pylib),
'-lpng', '-ljpeg', '-ltiff']
os.path.join(pwd, 'dependencies/lib', pylib)]
extra_compile_args = [
'-fPIC', '-std=c++14', '-DBOOST_ERROR_CODE_HEADER_ONLY', '-Wno-missing-braces'
]
if 'TRAVIS' in os.environ and os.environ['TRAVIS'] == 'true':
print('Travis CI build detected: disabling PNG support.')
extra_link_args += ['-ljpeg', '-ltiff']
extra_compile_args += ['-DLIBCARLA_IMAGE_WITH_PNG_SUPPORT=false']
else:
extra_link_args += ['-lpng', '-ljpeg', '-ltiff']
extra_compile_args += ['-DLIBCARLA_IMAGE_WITH_PNG_SUPPORT=true']
# @todo Why would we need this?
include_dirs += ['/usr/lib/gcc/x86_64-linux-gnu/7/include']
library_dirs += ['/usr/lib/gcc/x86_64-linux-gnu/7']
extra_link_args += ['/usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.a']
else:
libraries += ["boost_python", "boost_filesystem"]
raise NotImplementedError
elif os.name == "nt":
pwd = os.path.dirname(os.path.realpath(__file__))
pylib = "libboost_python%d%d-vc141-mt-x64-1_67.lib" % (sys.version_info.major, sys.version_info.minor)

View File

@ -255,10 +255,10 @@ cat >${CMAKE_CONFIG_FILE}.gen <<EOL
set(CARLA_VERSION $(get_carla_version))
add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY)
add_definitions(-DLIBCARLA_IMAGE_WITH_PNG_SUPPORT)
# Uncomment to force support for other image formats (require their respective
# libraries installed).
# Uncomment to force support for an specific image format (require their
# respective libraries installed).
# add_definitions(-DLIBCARLA_IMAGE_WITH_PNG_SUPPORT)
# add_definitions(-DLIBCARLA_IMAGE_WITH_JPEG_SUPPORT)
# add_definitions(-DLIBCARLA_IMAGE_WITH_TIFF_SUPPORT)
@ -278,8 +278,16 @@ elseif (CMAKE_BUILD_TYPE STREQUAL "Client")
set(RPCLIB_LIB_PATH "${RPCLIB_LIBSTDCXX_LIBPATH}")
set(BOOST_LIB_PATH "${BOOST_LIBPATH}")
endif ()
EOL
if "${TRAVIS}" -eq "true" ; then
log "Travis CI build detected: disabling PNG support."
echo "add_definitions(-DLIBCARLA_IMAGE_WITH_PNG_SUPPORT=false)" >> ${CMAKE_CONFIG_FILE}.gen
else
echo "add_definitions(-DLIBCARLA_IMAGE_WITH_PNG_SUPPORT=true)" >> ${CMAKE_CONFIG_FILE}.gen
fi
# -- Move files ----------------------------------------------------------------
move_if_changed "${LIBSTDCPP_TOOLCHAIN_FILE}.gen" "${LIBSTDCPP_TOOLCHAIN_FILE}"