Try fix setup.py to link against libcarla_client (Linux only)
This commit is contained in:
parent
4c0110c42f
commit
ca7a2dcbc7
|
@ -133,8 +133,7 @@ foreach(target carla_client_debug carla_client)
|
|||
"${BOOST_INCLUDE_PATH}"
|
||||
"${RPCLIB_INCLUDE_PATH}")
|
||||
|
||||
# @todo This was disabled because now everything is built in the setup.py.
|
||||
# install(TARGETS ${target} DESTINATION lib)
|
||||
install(TARGETS ${target} DESTINATION lib)
|
||||
endforeach(target)
|
||||
|
||||
# Specific options for debug.
|
||||
|
@ -142,4 +141,4 @@ set_target_properties(carla_client_debug PROPERTIES COMPILE_FLAGS ${CMAKE_CXX_FL
|
|||
target_compile_definitions(carla_client_debug PUBLIC -DBOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
||||
|
||||
# Specific options for release.
|
||||
set_target_properties(carla_client PROPERTIES COMPILE_FLAGS ${CMAKE_CXX_FLAGS_RELEASE})
|
||||
set_target_properties(carla_client PROPERTIES COMPILE_FLAGS ${CMAKE_CXX_FLAGS_RELEASE_CLIENT})
|
||||
|
|
|
@ -17,18 +17,22 @@ def get_libcarla_extensions():
|
|||
library_dirs = ['dependencies/lib']
|
||||
libraries = []
|
||||
|
||||
sources = ['source/libcarla/libcarla.cpp']
|
||||
|
||||
if os.name == "posix":
|
||||
if platform.dist()[0] == "Ubuntu":
|
||||
pwd = os.path.dirname(os.path.realpath(__file__))
|
||||
pylib = "libboost_python%d%d.a" % (sys.version_info.major,
|
||||
sys.version_info.minor)
|
||||
extra_link_args = [
|
||||
os.path.join(pwd, 'dependencies/lib/libcarla_client.a'),
|
||||
os.path.join(pwd, 'dependencies/lib/librpc.a'),
|
||||
os.path.join(pwd, 'dependencies/lib/libboost_filesystem.a'),
|
||||
os.path.join(pwd, 'dependencies/lib', pylib)]
|
||||
extra_compile_args = [
|
||||
'-fPIC', '-std=c++14', '-Wno-missing-braces',
|
||||
'-DBOOST_ERROR_CODE_HEADER_ONLY', '-DLIBCARLA_WITH_PYTHON_SUPPORT'
|
||||
'-DBOOST_ERROR_CODE_HEADER_ONLY', '-DLIBCARLA_WITH_PYTHON_SUPPORT',
|
||||
'-DLIBCARLA_ENABLE_LIFETIME_PROFILER',
|
||||
]
|
||||
if 'TRAVIS' in os.environ and os.environ['TRAVIS'] == 'true':
|
||||
print('Travis CI build detected: disabling PNG support.')
|
||||
|
@ -44,6 +48,8 @@ def get_libcarla_extensions():
|
|||
else:
|
||||
raise NotImplementedError
|
||||
elif os.name == "nt":
|
||||
sources += [x for x in walk('dependencies/include/carla', '*.cpp')]
|
||||
|
||||
pwd = os.path.dirname(os.path.realpath(__file__))
|
||||
pylib = "libboost_python%d%d-vc141-mt-x64-1_67.lib" % (
|
||||
sys.version_info.major,
|
||||
|
@ -55,7 +61,7 @@ def get_libcarla_extensions():
|
|||
|
||||
# https://docs.microsoft.com/es-es/cpp/porting/modifying-winver-and-win32-winnt
|
||||
extra_compile_args = [
|
||||
'/DPYTHON3X', '/DBOOST_ALL_NO_LIB', '/DBOOST_PYTHON_STATIC_LIB',
|
||||
'/DBOOST_ALL_NO_LIB', '/DBOOST_PYTHON_STATIC_LIB',
|
||||
'/DBOOST_ERROR_CODE_HEADER_ONLY', '/D_WIN32_WINNT=0x0501',
|
||||
'/DLIBCARLA_WITH_PYTHON_SUPPORT']
|
||||
else:
|
||||
|
@ -82,9 +88,6 @@ def get_libcarla_extensions():
|
|||
language='c++14',
|
||||
depends=depends)
|
||||
|
||||
sources = ['source/libcarla/libcarla.cpp']
|
||||
sources += [x for x in walk('dependencies/include/carla', '*.cpp')]
|
||||
|
||||
print('compiling:\n - %s' % '\n - '.join(sources))
|
||||
|
||||
return [make_extension('carla.libcarla', sources)]
|
||||
|
|
|
@ -241,6 +241,9 @@ set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -std=c++14 -pthread -fPIC" CACHE STRING
|
|||
set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra" CACHE STRING "" FORCE)
|
||||
# See https://bugs.llvm.org/show_bug.cgi?id=21629
|
||||
set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Wno-missing-braces" CACHE STRING "" FORCE)
|
||||
|
||||
# @todo These flags need to be compatible with setup.py compilation.
|
||||
set(CMAKE_CXX_FLAGS_RELEASE_CLIENT "\${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -std=c++14 -Wno-missing-braces -DBOOST_ERROR_CODE_HEADER_ONLY -DLIBCARLA_ENABLE_LIFETIME_PROFILER -DLIBCARLA_WITH_PYTHON_SUPPORT" CACHE STRING "" FORCE)
|
||||
EOL
|
||||
|
||||
# -- LIBCPP_TOOLCHAIN_FILE -----------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue