This repository has been archived by the owner. It is now read-only.
Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
394 additions
and 78 deletions.
- +116 −0 .github/workflows/build-cmake-conan.yml
- +1 −1 .github/workflows/reLCS_msvc_amd64.yml
- +1 −1 .github/workflows/reLCS_msvc_x86.yml
- +0 −44 .travis.yml
- +34 −0 cmake/FindMilesSDK.cmake
- +64 −0 cmake/Findopusfile.cmake
- +135 −0 conanfile.py
- +1 −1 premake5.lua
- +1 −1 src/CMakeLists.txt
- +1 −0 src/audio/AudioLogic.cpp
- +1 −1 src/audio/oal/stream.cpp
- +1 −1 src/audio/sampman_oal.cpp
- +11 −4 src/collision/Collision.cpp
- +2 −2 src/control/Script2.cpp
- +2 −2 src/control/Script7.cpp
- +3 −3 src/control/Script8.cpp
- +6 −4 src/core/Cam.cpp
- +1 −0 src/core/SurfaceTable.h
- +4 −4 src/render/Hud.cpp
- +9 −9 src/weapons/Weapon.cpp
There are no files selected for viewing
| @@ -0,0 +1,116 @@ | ||
| name: reVC conan+cmake | ||
| on: | ||
| pull_request: | ||
| push: | ||
| release: | ||
| types: published | ||
| jobs: | ||
| build-cmake: | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - os: 'windows-latest' | ||
| platform: 'gl3' | ||
| gl3_gfxlib: 'glfw' | ||
| audio: 'openal' | ||
| # - os: 'windows-latest' | ||
| # platform: 'gl3' | ||
| # gl3_gfxlib: 'sdl2' | ||
| # audio: 'openal' | ||
| - os: 'windows-latest' | ||
| platform: 'd3d9' | ||
| audio: 'openal' | ||
| # - os: 'windows-latest' | ||
| # platform: 'd3d9' | ||
| # audio: 'miles' | ||
| - os: 'ubuntu-latest' | ||
| platform: 'gl3' | ||
| gl3_gfxlib: 'glfw' | ||
| audio: 'openal' | ||
| # - os: 'ubuntu-latest' | ||
| # platform: 'gl3' | ||
| # gl3_gfxlib: 'sdl2' | ||
| # audio: 'openal' | ||
| - os: 'macos-latest' | ||
| platform: 'gl3' | ||
| gl3_gfxlib: 'glfw' | ||
| audio: 'openal' | ||
| # - os: 'macos-latest' | ||
| # platform: 'gl3' | ||
| # gl3_gfxlib: 'sdl2' | ||
| # audio: 'openal' | ||
| runs-on: ${{ matrix.os }} | ||
| continue-on-error: ${{ matrix.platform == 'ps2' || matrix.gl3_gfxlib == 'sdl2' || matrix.audio == 'miles' }} | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| with: | ||
| submodules: true | ||
| - name: "Checkout Miles SDK Import Library project" | ||
| uses: actions/checkout@v2 | ||
| if: ${{ matrix.audio == 'miles' }} | ||
| with: | ||
| repository: 'withmorten/re3mss' | ||
| path: 're3mss' | ||
| - uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: '3.x' | ||
| - name: "Use XCode 11 as default (conan-center-index does not provide XCode 12 binaries at the moment)" | ||
| if: startsWith(matrix.os, 'macos') | ||
| run: | | ||
| sudo xcode-select --switch /Applications/Xcode_11.7.app | ||
| - name: "Setup conan" | ||
| run: | | ||
| python -m pip install conan | ||
| conan config init | ||
| conan config set log.print_run_commands=True | ||
| conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan | ||
| conan remote add madebr_ps2dev https://api.bintray.com/conan/madebr/ps2dev | ||
| - name: "Add os=playstation2 + gcc.version=3.2 to .conan/settings.yml" | ||
| shell: python | ||
| run: | | ||
| import os, yaml | ||
| settings_path = os.path.expanduser("~/.conan/settings.yml") | ||
| yml = yaml.safe_load(open(settings_path)) | ||
| yml["os"]["playstation2"] = None | ||
| yml["compiler"]["gcc"]["version"].append("3.2") | ||
| yml["compiler"]["gcc"]["version"].sort() | ||
| yaml.safe_dump(yml, open(settings_path, "w")) | ||
| - name: "Create host profile" | ||
| shell: bash | ||
| run: | | ||
| if test "${{ matrix.platform }}" = "ps2"; then | ||
| cp vendor/librw/conan/playstation2 host_profile | ||
| else | ||
| cp ~/.conan/profiles/default host_profile | ||
| fi | ||
| - name: "Export Playstation 2 CMake toolchain conan recipe" | ||
| run: | | ||
| conan export vendor/librw/cmake/ps2toolchain ps2dev-cmaketoolchain/master@ | ||
| - name: "Export librw conan recipe" | ||
| run: | | ||
| conan export vendor/librw librw/master@ | ||
| - name: "Export Miles SDK conan recipe" | ||
| if: ${{ matrix.audio == 'miles' }} | ||
| run: | | ||
| conan export re3mss miles-sdk/master@ | ||
| - name: "Download/build dependencies (conan install)" | ||
| run: | | ||
| conan install ${{ github.workspace }} reVC/master@ -if build -o reVC:audio=${{ matrix.audio }} -o librw:platform=${{ matrix.platform }} -o librw:gl3_gfxlib=${{ matrix.gl3_gfxlib || 'glfw' }} --build missing -pr:h ./host_profile -pr:b default -s reVC:build_type=RelWithDebInfo -s librw:build_type=RelWithDebInfo | ||
| env: | ||
| CONAN_SYSREQUIRES_MODE: enabled | ||
| - name: "Build reVC (conan build)" | ||
| run: | | ||
| conan build ${{ github.workspace }} -if build -bf build -pf package | ||
| - name: "Package reVC (conan package)" | ||
| run: | | ||
| conan package ${{ github.workspace }} -if build -bf build -pf package | ||
| - name: "Create binary package (cpack)" | ||
| working-directory: ./build | ||
| run: | | ||
| cpack -C RelWithDebInfo | ||
| - name: "Archive binary package (github artifacts)" | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: "${{ matrix.os }}-${{ matrix.platform }}" | ||
| path: build/*.tar.xz | ||
| if-no-files-found: error |
| @@ -0,0 +1,34 @@ | ||
| # - Find Miles SDK | ||
| # Find the Miles SDK header + import library | ||
| # | ||
| # MilesSDK_INCLUDE_DIR - Where to find mss.h | ||
| # MilesSDK_LIBRARIES - List of libraries when using MilesSDK. | ||
| # MilesSDK_FOUND - True if Miles SDK found. | ||
| # MilesSDK::MilesSDK - Imported library of Miles SDK | ||
|
|
||
| find_path(MilesSDK_INCLUDE_DIR mss.h | ||
| PATHS "${MilesSDK_DIR}" | ||
| PATH_SUFFIXES include | ||
| ) | ||
|
|
||
| if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
| set(_miles_sdk_libname mss64) | ||
| else() | ||
| set(_miles_sdk_libname mss32) | ||
| endif() | ||
|
|
||
| find_library(MilesSDK_LIBRARIES NAMES ${_miles_sdk_libname} | ||
| PATHS "${MilesSDK_DIR}" | ||
| PATH_SUFFIXES lib | ||
| ) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(MilesSDK DEFAULT_MSG MilesSDK_LIBRARIES MilesSDK_INCLUDE_DIR) | ||
|
|
||
| if(NOT TARGET MilesSDK::MilesSDK) | ||
| add_library(MilesSDK::MilesSDK UNKNOWN IMPORTED) | ||
| set_target_properties(MilesSDK::MilesSDK PROPERTIES | ||
| IMPORTED_LOCATION "${MilesSDK_LIBRARIES} | ||
| INTERFACE_INCLUDE_DIRECTORIES "${MilesSDK_INCLUDE_DIR}" | ||
| ) | ||
| endif() |
| @@ -0,0 +1,64 @@ | ||
| # - Try to find opusfile | ||
| # | ||
| # Once done this will define | ||
| # | ||
| # OPUSFILE_FOUND - system has opusfile | ||
| # OPUSFILE_INCLUDE_DIRS - the opusfile include directories | ||
| # OPUSFILE_LIBRARIES - Link these to use opusfile | ||
| # OPUSFILE_CFLAGS - Compile options to use opusfile | ||
| # opusfile::opusfile - Imported library of opusfile | ||
| # | ||
|
|
||
| # FIXME: opusfile does not ship an official opusfile cmake script, | ||
| # rename this file/variables/target when/if it has. | ||
|
|
||
| find_package(PkgConfig QUIET) | ||
| if(PKG_CONFIG_FOUND) | ||
| pkg_search_module(PKG_OPUSFILE "opusfile") | ||
| endif() | ||
|
|
||
| find_path(OPUSFILE_INCLUDE_DIR | ||
| NAMES | ||
| opusfile.h | ||
| PATH_SUFFIXES | ||
| opusfile | ||
| HINTS | ||
| ${PKG_OPUSFILE_INCLUDE_DIRS} | ||
| PATHS | ||
| /usr/include | ||
| /usr/local/include | ||
| /opt/local/include | ||
| /sw/include | ||
| ) | ||
|
|
||
| find_library(OPUSFILE_LIBRARY | ||
| NAMES | ||
| opusfile | ||
| HINTS | ||
| ${PKG_OPUSFILE_LIBRARIES} | ||
| PATHS | ||
| /usr/lib | ||
| /usr/local/lib | ||
| /opt/local/lib | ||
| /sw/lib | ||
| ) | ||
|
|
||
| set(OPUSFILE_CFLAGS "${PKG_OPUSFILE_CFLAGS_OTHER}" CACHE STRING "CFLAGS of opusfile") | ||
|
|
||
| set(OPUSFILE_INCLUDE_DIRS "${OPUSFILE_INCLUDE_DIR}") | ||
| set(OPUSFILE_LIBRARIES "${OPUSFILE_LIBRARY}") | ||
|
|
||
| if (OPUSFILE_INCLUDE_DIRS AND OPUSFILE_LIBRARIES) | ||
| set(OPUSFILE_FOUND TRUE) | ||
| endif (OPUSFILE_INCLUDE_DIRS AND OPUSFILE_LIBRARIES) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(opusfile DEFAULT_MSG OPUSFILE_INCLUDE_DIRS OPUSFILE_LIBRARIES) | ||
|
|
||
| if(NOT TARGET opusfile::opusfile) | ||
| add_library(__opusfile INTERFACE) | ||
| target_compile_options(__opusfile INTERFACE ${OPUSFILE_CFLAGS}) | ||
| target_include_directories(__opusfile INTERFACE ${OPUSFILE_INCLUDE_DIRS}) | ||
| target_link_libraries(__opusfile INTERFACE ${OPUSFILE_LIBRARIES}) | ||
| add_library(opusfile::opusfile ALIAS __opusfile) | ||
| endif() |
Oops, something went wrong.