1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-07-19 11:18:00 +02:00

conan: update + latest versions

This commit is contained in:
Anonymous Maarten 2018-07-06 02:25:48 +02:00
parent 0915054d93
commit 7eab14bee0
14 changed files with 57 additions and 66 deletions

View File

@ -32,7 +32,6 @@ set(_ARGS_ONEVAL
BUILD_NAME
CONAN_ARCH
CONAN_PROFILE
CMAKE_GENERATOR
COVERAGE_COMMAND
@ -115,10 +114,17 @@ if(USE_CONAN)
set(CONAN_CONFIGURATION "Release")
endif()
if(BUILD_VIEWER)
set(_BUILD_VIEWER True)
else()
set(_BUILD_VIEWER False)
endif()
execute_process(
COMMAND
"${CONAN_BIN}" install "${CTEST_SOURCE_DIRECTORY}" -pr "${CONAN_PROFILE}"
-s arch=${CONAN_ARCH} -s build_type=${CONAN_CONFIGURATION} --build missing
"${CONAN_BIN}" install "${CTEST_SOURCE_DIRECTORY}"
-s arch=${CONAN_ARCH} -s build_type=${CONAN_CONFIGURATION}
-o viewer=${_BUILD_VIEWER} --build missing
WORKING_DIRECTORY "${CTEST_BINARY_DIRECTORY}"
RESULT_VARIABLE RES
)
@ -129,6 +135,16 @@ if(USE_CONAN)
list(APPEND CONFIGURE_EXTRA_OPTIONS
"-DBOOST_STATIC=True"
)
execute_process(
COMMAND
"${CONAN_BIN}" remove -f -b -s "*"
WORKING_DIRECTORY "${CTEST_BINARY_DIRECTORY}"
RESULT_VARIABLE RES
)
if(RES)
message(FATAL_ERROR "conan remove failed")
endif()
endif()
# CTEST_CONFIGURATION_TYPE is needed on Windows (no leading underscore)

View File

@ -14,4 +14,3 @@ else()
endif()
set(CONAN_ARCH "x86_64")
set(CONAN_PROFILE "${CTEST_SOURCE_DIRECTORY}/scripts/conan/darwin")

View File

@ -14,4 +14,3 @@ else()
endif()
set(CONAN_ARCH "x86_64")
set(CONAN_PROFILE "${CTEST_SOURCE_DIRECTORY}/scripts/conan/linux")

View File

@ -32,7 +32,6 @@ else()
message(FATAL_ERROR "Unknown configuration '${CONFIGURATION}'")
endif()
set(CONAN_PROFILE "${CTEST_SOURCE_DIRECTORY}/scripts/conan/windows")
set(CONAN_ARCH "x86_64")
set(BUILD_TOOLS TRUE)

View File

@ -27,17 +27,14 @@ function(rwdep_wrap_find_packages)
endfunction()
function(rwdep_wrap_conan_target TARGET CONAN_NAME)
add_library("CONAN_${CONAN_NAME}" INTERFACE)
target_link_libraries("CONAN_${CONAN_NAME}" INTERFACE "CONAN_PKG::${CONAN_NAME}")
add_library("${TARGET}" ALIAS "CONAN_${CONAN_NAME}")
string(RANDOM RND)
set(TGT "CONAN_${CONAN_NAME}_${RND}")
add_library("${TGT}" INTERFACE)
target_link_libraries("${TGT}" INTERFACE "CONAN_PKG::${CONAN_NAME}")
add_library("${TARGET}" ALIAS "${TGT}")
endfunction()
function(rwdep_wrap_conan_targets)
rwdep_wrap_conan_target(boost boost)
rwdep_wrap_conan_target(boost_program_options boost)
rwdep_wrap_conan_target(boost_filesystem boost)
rwdep_wrap_conan_target(boost_unit_test_framework boost)
rwdep_wrap_conan_target(OpenAL::OpenAL openal)
rwdep_wrap_conan_target(bullet::bullet bullet)
rwdep_wrap_conan_target(glm::glm glm)
@ -46,4 +43,10 @@ function(rwdep_wrap_conan_targets)
if(BUILD_TOOLS)
rwdep_wrap_conan_target(Freetype::Freetype freetype)
endif()
rwdep_wrap_conan_target(Boost::boost boost)
rwdep_wrap_conan_target(Boost::filesystem boost)
rwdep_wrap_conan_target(Boost::program_options boost)
rwdep_wrap_conan_target(Boost::system boost)
rwdep_wrap_conan_target(Boost::unit_test_framework boost)
endfunction()

View File

@ -64,6 +64,18 @@ else()
message(FATAL_ERROR "Unknown platform \"${CMAKE_SYSTEM_NAME}\". please update CMakeLists.txt.")
endif()
target_compile_definitions(rw_interface
INTERFACE
BOOST_ALL_NO_LIB
)
if(NOT BOOST_STATIC)
target_compile_definitions(rw_interface
INTERFACE
BOOST_ALL_DYN_LINK
)
endif()
if(USE_CONAN)
if(CONAN_SETTINGS_COMPILER_LIBCXX STREQUAL "libstdc++11")
target_compile_definitions(rw_interface INTERFACE _GLIBCXX_USE_CXX11_ABI=1)
@ -92,14 +104,6 @@ else()
message(FATAL_ERROR "Illegal FILESYSTEM_LIBRARY option. (was '${FILESYSTEM_LIBRARY}')")
endif()
if(NOT BOOST_STATIC)
target_compile_definitions(rw_interface
INTERFACE
BOOST_ALL_DYN_LINK
)
endif()
if(ENABLE_SCRIPT_DEBUG)
target_compile_definitions(rw_interface
INTERFACE

View File

@ -1,9 +1,6 @@
from conans import ConanFile, CMake
from conans.errors import ConanException
# FIXME:
# - no sound in cutscenes. Also no subtitles.
class OpenrwConan(ConanFile):
name = 'openrw'
@ -20,11 +17,9 @@ class OpenrwConan(ConanFile):
default_options = (
'test_data=False',
'viewer=False',
'tools=False',
'viewer=True',
'tools=True',
'bullet:shared=False',
'ffmpeg:iconv=False',
'libalsa:disable_python=True', # https://github.com/conan-community/community/issues/3
'sdl2:sdl2main=False',
)
@ -42,13 +37,17 @@ class OpenrwConan(ConanFile):
'boost/1.67.0@conan/stable',
),
'viewer': (
'Qt/5.11@bincrafters/stable',
'Qt/5.11.1@bincrafters/stable',
),
'tools': (
'freetype/2.9.0@bincrafters/stable',
),
}
def configure(self):
if self.options.viewer:
self.options['Qt'].opengl = 'desktop'
def requirements(self):
for dep in self._rw_dependencies['game']:
self.requires(dep)

View File

@ -1,4 +1,3 @@
# fixme: conan support
find_package(Qt5 REQUIRED COMPONENTS Gui)
add_executable(rwfontmap
rwfontmap.cpp
@ -15,4 +14,3 @@ target_link_libraries(rwfontmap
install(TARGETS rwfontmap
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)

View File

@ -10,7 +10,6 @@ from conans.client import conan_api
openrw_path = Path(__file__).resolve().parents[2]
windows_profile = openrw_path / 'scripts' / 'conan' / 'windows'
cmake_generator_lookup = {
2015: 'Visual Studio 14 2015',
2017: 'Visual Studio 15 2017',
@ -28,13 +27,14 @@ def to_cmake_generator(vs_version, arch):
def create_solution(path, vs_version, arch):
conan, _, _ = conan_api.ConanAPIV1.factory()
conan.remote_add(remote='bincrafters', url='https://api.bintray.com/conan/bincrafters/public-conan', force=True)
conan.install(path=openrw_path, profile_name=windows_profile, generators=('cmake_multi',),
options=('openrw:viewer=False', ), settings=('build_type=Debug', ), install_folder=path)
conan.install(path=openrw_path, profile_name=windows_profile, generators=('cmake_multi',),
options=('openrw:viewer=False', ), settings=('build_type=Release', ), install_folder=path)
conan.install(path=openrw_path, generators=('cmake_multi',), build=['missing', ],
settings=('build_type=Debug', ), install_folder=path)
conan.install(path=openrw_path, generators=('cmake_multi',), build=['missing', ],
settings=('build_type=Release', ), install_folder=path)
cmake_generator = to_cmake_generator(vs_version=vs_version, arch=arch)
subprocess.run([
'cmake', '-DUSE_CONAN=1', '-DBOOST_STATIC=TRUE', '-DBUILD_TESTS=1',
'cmake', '-DUSE_CONAN=TRUE', '-DBOOST_STATIC=TRUE',
'-DBUILD_TESTS=TRUE', '-DBUILD_VIEWER=TRUE', '-DBUILD_TOOLS=TRUE',
'-G{}'.format(cmake_generator), str(openrw_path),
], cwd=path, check=True)

View File

@ -1,9 +0,0 @@
include(default)
[options]
openrw:tools=True
openrw:viewer=True
# https://github.com/bincrafters/community/issues/120
ffmpeg:vdpau=False
ffmpeg:vaapi=False
ffmpeg:xcb=False

View File

@ -1,12 +0,0 @@
include(default)
[options]
openrw:tools=True
openrw:viewer=True
sdl2:esd=False
sdl2:wayland=True
sdl2:x11=True
# https://github.com/bincrafters/community/issues/120
ffmpeg:vdpau=False
ffmpeg:vaapi=False
ffmpeg:xcb=False

View File

@ -1,6 +0,0 @@
include(default)
[options]
openrw:tools=True
openrw:viewer=True
ffmpeg:qsv=False

View File

@ -11,6 +11,7 @@ RUN apt-get update \
python3-distutils \
python3-setuptools \
python3-wheel \
wget \
# packet build requirements \
git \
autoconf \

View File

@ -69,10 +69,10 @@ target_include_directories(rwtests
target_link_libraries(rwtests
PRIVATE
Boost::unit_test_framework
rwengine
SDL2::SDL2
Boost::filesystem
Boost::unit_test_framework
)
openrw_target_apply_options(TARGET rwtests)