mirror of
https://github.com/rwengine/openrw.git
synced 2024-09-15 06:52:34 +02:00
conan: update + latest versions
This commit is contained in:
parent
0915054d93
commit
7eab14bee0
@ -32,7 +32,6 @@ set(_ARGS_ONEVAL
|
|||||||
BUILD_NAME
|
BUILD_NAME
|
||||||
|
|
||||||
CONAN_ARCH
|
CONAN_ARCH
|
||||||
CONAN_PROFILE
|
|
||||||
|
|
||||||
CMAKE_GENERATOR
|
CMAKE_GENERATOR
|
||||||
COVERAGE_COMMAND
|
COVERAGE_COMMAND
|
||||||
@ -115,10 +114,17 @@ if(USE_CONAN)
|
|||||||
set(CONAN_CONFIGURATION "Release")
|
set(CONAN_CONFIGURATION "Release")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_VIEWER)
|
||||||
|
set(_BUILD_VIEWER True)
|
||||||
|
else()
|
||||||
|
set(_BUILD_VIEWER False)
|
||||||
|
endif()
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND
|
COMMAND
|
||||||
"${CONAN_BIN}" install "${CTEST_SOURCE_DIRECTORY}" -pr "${CONAN_PROFILE}"
|
"${CONAN_BIN}" install "${CTEST_SOURCE_DIRECTORY}"
|
||||||
-s arch=${CONAN_ARCH} -s build_type=${CONAN_CONFIGURATION} --build missing
|
-s arch=${CONAN_ARCH} -s build_type=${CONAN_CONFIGURATION}
|
||||||
|
-o viewer=${_BUILD_VIEWER} --build missing
|
||||||
WORKING_DIRECTORY "${CTEST_BINARY_DIRECTORY}"
|
WORKING_DIRECTORY "${CTEST_BINARY_DIRECTORY}"
|
||||||
RESULT_VARIABLE RES
|
RESULT_VARIABLE RES
|
||||||
)
|
)
|
||||||
@ -129,6 +135,16 @@ if(USE_CONAN)
|
|||||||
list(APPEND CONFIGURE_EXTRA_OPTIONS
|
list(APPEND CONFIGURE_EXTRA_OPTIONS
|
||||||
"-DBOOST_STATIC=True"
|
"-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()
|
endif()
|
||||||
|
|
||||||
# CTEST_CONFIGURATION_TYPE is needed on Windows (no leading underscore)
|
# CTEST_CONFIGURATION_TYPE is needed on Windows (no leading underscore)
|
||||||
|
@ -14,4 +14,3 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CONAN_ARCH "x86_64")
|
set(CONAN_ARCH "x86_64")
|
||||||
set(CONAN_PROFILE "${CTEST_SOURCE_DIRECTORY}/scripts/conan/darwin")
|
|
||||||
|
@ -14,4 +14,3 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CONAN_ARCH "x86_64")
|
set(CONAN_ARCH "x86_64")
|
||||||
set(CONAN_PROFILE "${CTEST_SOURCE_DIRECTORY}/scripts/conan/linux")
|
|
||||||
|
@ -32,7 +32,6 @@ else()
|
|||||||
message(FATAL_ERROR "Unknown configuration '${CONFIGURATION}'")
|
message(FATAL_ERROR "Unknown configuration '${CONFIGURATION}'")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CONAN_PROFILE "${CTEST_SOURCE_DIRECTORY}/scripts/conan/windows")
|
|
||||||
set(CONAN_ARCH "x86_64")
|
set(CONAN_ARCH "x86_64")
|
||||||
|
|
||||||
set(BUILD_TOOLS TRUE)
|
set(BUILD_TOOLS TRUE)
|
||||||
|
@ -27,17 +27,14 @@ function(rwdep_wrap_find_packages)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(rwdep_wrap_conan_target TARGET CONAN_NAME)
|
function(rwdep_wrap_conan_target TARGET CONAN_NAME)
|
||||||
add_library("CONAN_${CONAN_NAME}" INTERFACE)
|
string(RANDOM RND)
|
||||||
target_link_libraries("CONAN_${CONAN_NAME}" INTERFACE "CONAN_PKG::${CONAN_NAME}")
|
set(TGT "CONAN_${CONAN_NAME}_${RND}")
|
||||||
add_library("${TARGET}" ALIAS "CONAN_${CONAN_NAME}")
|
add_library("${TGT}" INTERFACE)
|
||||||
|
target_link_libraries("${TGT}" INTERFACE "CONAN_PKG::${CONAN_NAME}")
|
||||||
|
add_library("${TARGET}" ALIAS "${TGT}")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(rwdep_wrap_conan_targets)
|
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(OpenAL::OpenAL openal)
|
||||||
rwdep_wrap_conan_target(bullet::bullet bullet)
|
rwdep_wrap_conan_target(bullet::bullet bullet)
|
||||||
rwdep_wrap_conan_target(glm::glm glm)
|
rwdep_wrap_conan_target(glm::glm glm)
|
||||||
@ -46,4 +43,10 @@ function(rwdep_wrap_conan_targets)
|
|||||||
if(BUILD_TOOLS)
|
if(BUILD_TOOLS)
|
||||||
rwdep_wrap_conan_target(Freetype::Freetype freetype)
|
rwdep_wrap_conan_target(Freetype::Freetype freetype)
|
||||||
endif()
|
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()
|
endfunction()
|
||||||
|
@ -64,6 +64,18 @@ else()
|
|||||||
message(FATAL_ERROR "Unknown platform \"${CMAKE_SYSTEM_NAME}\". please update CMakeLists.txt.")
|
message(FATAL_ERROR "Unknown platform \"${CMAKE_SYSTEM_NAME}\". please update CMakeLists.txt.")
|
||||||
endif()
|
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(USE_CONAN)
|
||||||
if(CONAN_SETTINGS_COMPILER_LIBCXX STREQUAL "libstdc++11")
|
if(CONAN_SETTINGS_COMPILER_LIBCXX STREQUAL "libstdc++11")
|
||||||
target_compile_definitions(rw_interface INTERFACE _GLIBCXX_USE_CXX11_ABI=1)
|
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}')")
|
message(FATAL_ERROR "Illegal FILESYSTEM_LIBRARY option. (was '${FILESYSTEM_LIBRARY}')")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(NOT BOOST_STATIC)
|
|
||||||
target_compile_definitions(rw_interface
|
|
||||||
INTERFACE
|
|
||||||
BOOST_ALL_DYN_LINK
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_SCRIPT_DEBUG)
|
if(ENABLE_SCRIPT_DEBUG)
|
||||||
target_compile_definitions(rw_interface
|
target_compile_definitions(rw_interface
|
||||||
INTERFACE
|
INTERFACE
|
||||||
|
15
conanfile.py
15
conanfile.py
@ -1,9 +1,6 @@
|
|||||||
from conans import ConanFile, CMake
|
from conans import ConanFile, CMake
|
||||||
from conans.errors import ConanException
|
from conans.errors import ConanException
|
||||||
|
|
||||||
# FIXME:
|
|
||||||
# - no sound in cutscenes. Also no subtitles.
|
|
||||||
|
|
||||||
|
|
||||||
class OpenrwConan(ConanFile):
|
class OpenrwConan(ConanFile):
|
||||||
name = 'openrw'
|
name = 'openrw'
|
||||||
@ -20,11 +17,9 @@ class OpenrwConan(ConanFile):
|
|||||||
|
|
||||||
default_options = (
|
default_options = (
|
||||||
'test_data=False',
|
'test_data=False',
|
||||||
'viewer=False',
|
'viewer=True',
|
||||||
'tools=False',
|
'tools=True',
|
||||||
'bullet:shared=False',
|
'bullet:shared=False',
|
||||||
'ffmpeg:iconv=False',
|
|
||||||
'libalsa:disable_python=True', # https://github.com/conan-community/community/issues/3
|
|
||||||
'sdl2:sdl2main=False',
|
'sdl2:sdl2main=False',
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -42,13 +37,17 @@ class OpenrwConan(ConanFile):
|
|||||||
'boost/1.67.0@conan/stable',
|
'boost/1.67.0@conan/stable',
|
||||||
),
|
),
|
||||||
'viewer': (
|
'viewer': (
|
||||||
'Qt/5.11@bincrafters/stable',
|
'Qt/5.11.1@bincrafters/stable',
|
||||||
),
|
),
|
||||||
'tools': (
|
'tools': (
|
||||||
'freetype/2.9.0@bincrafters/stable',
|
'freetype/2.9.0@bincrafters/stable',
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def configure(self):
|
||||||
|
if self.options.viewer:
|
||||||
|
self.options['Qt'].opengl = 'desktop'
|
||||||
|
|
||||||
def requirements(self):
|
def requirements(self):
|
||||||
for dep in self._rw_dependencies['game']:
|
for dep in self._rw_dependencies['game']:
|
||||||
self.requires(dep)
|
self.requires(dep)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# fixme: conan support
|
|
||||||
find_package(Qt5 REQUIRED COMPONENTS Gui)
|
find_package(Qt5 REQUIRED COMPONENTS Gui)
|
||||||
add_executable(rwfontmap
|
add_executable(rwfontmap
|
||||||
rwfontmap.cpp
|
rwfontmap.cpp
|
||||||
@ -15,4 +14,3 @@ target_link_libraries(rwfontmap
|
|||||||
install(TARGETS rwfontmap
|
install(TARGETS rwfontmap
|
||||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||||
)
|
)
|
||||||
|
|
@ -10,7 +10,6 @@ from conans.client import conan_api
|
|||||||
|
|
||||||
|
|
||||||
openrw_path = Path(__file__).resolve().parents[2]
|
openrw_path = Path(__file__).resolve().parents[2]
|
||||||
windows_profile = openrw_path / 'scripts' / 'conan' / 'windows'
|
|
||||||
cmake_generator_lookup = {
|
cmake_generator_lookup = {
|
||||||
2015: 'Visual Studio 14 2015',
|
2015: 'Visual Studio 14 2015',
|
||||||
2017: 'Visual Studio 15 2017',
|
2017: 'Visual Studio 15 2017',
|
||||||
@ -28,13 +27,14 @@ def to_cmake_generator(vs_version, arch):
|
|||||||
def create_solution(path, vs_version, arch):
|
def create_solution(path, vs_version, arch):
|
||||||
conan, _, _ = conan_api.ConanAPIV1.factory()
|
conan, _, _ = conan_api.ConanAPIV1.factory()
|
||||||
conan.remote_add(remote='bincrafters', url='https://api.bintray.com/conan/bincrafters/public-conan', force=True)
|
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',),
|
conan.install(path=openrw_path, generators=('cmake_multi',), build=['missing', ],
|
||||||
options=('openrw:viewer=False', ), settings=('build_type=Debug', ), install_folder=path)
|
settings=('build_type=Debug', ), install_folder=path)
|
||||||
conan.install(path=openrw_path, profile_name=windows_profile, generators=('cmake_multi',),
|
conan.install(path=openrw_path, generators=('cmake_multi',), build=['missing', ],
|
||||||
options=('openrw:viewer=False', ), settings=('build_type=Release', ), install_folder=path)
|
settings=('build_type=Release', ), install_folder=path)
|
||||||
cmake_generator = to_cmake_generator(vs_version=vs_version, arch=arch)
|
cmake_generator = to_cmake_generator(vs_version=vs_version, arch=arch)
|
||||||
subprocess.run([
|
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),
|
'-G{}'.format(cmake_generator), str(openrw_path),
|
||||||
], cwd=path, check=True)
|
], cwd=path, check=True)
|
||||||
|
|
||||||
|
@ -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
|
|
@ -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
|
|
@ -1,6 +0,0 @@
|
|||||||
include(default)
|
|
||||||
|
|
||||||
[options]
|
|
||||||
openrw:tools=True
|
|
||||||
openrw:viewer=True
|
|
||||||
ffmpeg:qsv=False
|
|
@ -11,6 +11,7 @@ RUN apt-get update \
|
|||||||
python3-distutils \
|
python3-distutils \
|
||||||
python3-setuptools \
|
python3-setuptools \
|
||||||
python3-wheel \
|
python3-wheel \
|
||||||
|
wget \
|
||||||
# packet build requirements \
|
# packet build requirements \
|
||||||
git \
|
git \
|
||||||
autoconf \
|
autoconf \
|
||||||
|
@ -69,10 +69,10 @@ target_include_directories(rwtests
|
|||||||
|
|
||||||
target_link_libraries(rwtests
|
target_link_libraries(rwtests
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
Boost::unit_test_framework
|
||||||
rwengine
|
rwengine
|
||||||
SDL2::SDL2
|
SDL2::SDL2
|
||||||
Boost::filesystem
|
Boost::filesystem
|
||||||
Boost::unit_test_framework
|
|
||||||
)
|
)
|
||||||
|
|
||||||
openrw_target_apply_options(TARGET rwtests)
|
openrw_target_apply_options(TARGET rwtests)
|
||||||
|
Loading…
Reference in New Issue
Block a user