()
| 15 | |
| 16 | |
| 17 | def get_libcarla_extensions(): |
| 18 | include_dirs = ['dependencies/include'] |
| 19 | |
| 20 | library_dirs = ['dependencies/lib'] |
| 21 | libraries = [] |
| 22 | |
| 23 | |
| 24 | sources = ['source/libcarla/libcarla.cpp'] |
| 25 | |
| 26 | def walk(folder, file_filter='*'): |
| 27 | for root, _, filenames in os.walk(folder): |
| 28 | for filename in fnmatch.filter(filenames, file_filter): |
| 29 | yield os.path.join(root, filename) |
| 30 | |
| 31 | if os.name == "posix": |
| 32 | # @todo Replace deprecated method. |
| 33 | linux_distro = platform.dist()[0] # pylint: disable=W1505 |
| 34 | if linux_distro.lower() in ["ubuntu", "debian", "deepin"]: |
| 35 | pwd = os.path.dirname(os.path.realpath(__file__)) |
| 36 | pylib = "libboost_python%d%d.a" % (sys.version_info.major, |
| 37 | sys.version_info.minor) |
| 38 | numpylib = "libboost_numpy%d%d.a" % (sys.version_info.major, |
| 39 | sys.version_info.minor) |
| 40 | extra_link_args = [ |
| 41 | os.path.join(pwd, 'dependencies/lib/libcarla_client.a'), |
| 42 | os.path.join(pwd, 'dependencies/lib/librpc.a'), |
| 43 | os.path.join(pwd, 'dependencies/lib/libboost_filesystem.a'), |
| 44 | os.path.join(pwd, 'dependencies/lib/libRecast.a'), |
| 45 | os.path.join(pwd, 'dependencies/lib/libDetour.a'), |
| 46 | os.path.join(pwd, 'dependencies/lib/libDetourCrowd.a'), |
| 47 | os.path.join(pwd, 'dependencies/lib', pylib), |
| 48 | os.path.join(pwd, 'dependencies/lib', numpylib)] |
| 49 | |
| 50 | # Additional link libraries. @todo Get order from pkg-config or cmake. |
| 51 | extra_link_args += [ |
| 52 | '-ldl', '-lm', '-lpthread', '-lrt'] |
| 53 | |
| 54 | # LibOsmium link libraries. @todo Get order from pkg-config or cmake. |
| 55 | extra_link_args += [ |
| 56 | '-lbz2', '-lexpat'] |
| 57 | |
| 58 | extra_compile_args = [ |
| 59 | '-isystem', 'dependencies/include/system', '-fPIC', '-std=c++14', '-O3', |
| 60 | '-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wno-self-assign-overloaded', |
| 61 | '-Wdeprecated', '-Wno-shadow', '-Wuninitialized', '-Wunreachable-code', |
| 62 | '-Wpessimizing-move', '-Wold-style-cast', '-Wnull-dereference', |
| 63 | '-Wduplicate-enum', '-Wnon-virtual-dtor', '-Wheader-hygiene', |
| 64 | '-Wconversion', '-Wfloat-overflow-conversion', '-Wsign-conversion', |
| 65 | '-Wno-unused-parameter', |
| 66 | '-DBOOST_ERROR_CODE_HEADER_ONLY', '-DLIBCARLA_WITH_PYTHON_SUPPORT' |
| 67 | ] |
| 68 | |
| 69 | if 'BUILD_RSS_VARIANT' in os.environ and os.environ['BUILD_RSS_VARIANT'] == 'true': |
| 70 | print('Building AD RSS variant.') |
| 71 | extra_compile_args += ['-DLIBCARLA_RSS_ENABLED'] |
| 72 | extra_link_args += [os.path.join(pwd, 'dependencies/lib/libad-rss.a')] |
| 73 | |
| 74 | if True: #'TRAVIS' in os.environ and os.environ['TRAVIS'] == 'true': |
no test coverage detected