diff --git a/.travis.yml b/.travis.yml index 70a120346..47ad49e55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/LibCarla/source/carla/image/ImageIOConfig.h b/LibCarla/source/carla/image/ImageIOConfig.h index 87bd9590b..2d6c94a9f 100644 --- a/LibCarla/source/carla/image/ImageIOConfig.h +++ b/LibCarla/source/carla/image/ImageIOConfig.h @@ -307,7 +307,19 @@ namespace detail { struct tiff : detail::io_impl {}; - struct any : detail::io_any {}; +#if LIBCARLA_IMAGE_WITH_PNG_SUPPORT + + struct any : detail::io_any {}; + +#elif LIBCARLA_IMAGE_WITH_TIFF_SUPPORT + + struct any : detail::io_any {}; + +#else // Then for sure this one is available. + + struct any : detail::io_any {}; + +#endif } // namespace io } // namespace image diff --git a/PythonAPI/setup.py b/PythonAPI/setup.py index cd3ebea28..502fdcf20 100644 --- a/PythonAPI/setup.py +++ b/PythonAPI/setup.py @@ -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) diff --git a/Util/BuildTools/Setup.sh b/Util/BuildTools/Setup.sh index ba2ca7d31..d79ae0c13 100755 --- a/Util/BuildTools/Setup.sh +++ b/Util/BuildTools/Setup.sh @@ -255,10 +255,10 @@ cat >${CMAKE_CONFIG_FILE}.gen <> ${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}"