Update workflow (#1130)

This commit is contained in:
Marcin Michalski 2021-03-26 14:37:02 +01:00 committed by GitHub
parent 9c9b85ac5e
commit b6399a8ad9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 28 deletions

View File

@ -38,15 +38,15 @@ jobs:
cc: cl.exe cc: cl.exe
triplet: x64-windows triplet: x64-windows
packages: > packages: >
boost-iostreams boost-asio boost-system boost-variant boost-lockfree luajit glew boost-iostreams boost-asio boost-system boost-variant boost-lockfree glew
boost-filesystem boost-uuid physfs openal-soft libogg libvorbis zlib opengl boost-filesystem boost-uuid physfs openal-soft libogg lua luajit libvorbis zlib opengl
- name: ubuntu-gcc - name: ubuntu-gcc
os: ubuntu os: ubuntu
cxx: g++ cxx: g++
cc: gcc cc: gcc
triplet: x64-linux triplet: x64-linux
packages: > packages: >
boost-iostreams boost-asio boost-system boost-variant boost-lockfree luajit glew boost-iostreams boost-asio boost-system boost-variant boost-lockfree glew
boost-filesystem boost-uuid physfs openal-soft libogg libvorbis zlib opengl boost-filesystem boost-uuid physfs openal-soft libogg libvorbis zlib opengl
- name: ubuntu-clang - name: ubuntu-clang
os: ubuntu os: ubuntu
@ -54,7 +54,7 @@ jobs:
cc: clang cc: clang
triplet: x64-linux triplet: x64-linux
packages: > packages: >
boost-iostreams boost-asio boost-system boost-variant boost-lockfree luajit glew boost-iostreams boost-asio boost-system boost-variant boost-lockfree glew
boost-filesystem boost-uuid physfs openal-soft libogg libvorbis zlib opengl boost-filesystem boost-uuid physfs openal-soft libogg libvorbis zlib opengl
- name: macos-clang - name: macos-clang
os: macos os: macos
@ -62,8 +62,8 @@ jobs:
cc: clang cc: clang
triplet: x64-osx triplet: x64-osx
packages: > packages: >
boost-iostreams boost-asio boost-system boost-variant boost-lockfree luajit glew boost-iostreams boost-asio boost-system boost-variant boost-lockfree glew
boost-filesystem boost-uuid physfs openal-soft libogg libvorbis zlib opengl boost-filesystem boost-uuid openal-soft libogg libvorbis zlib opengl
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -77,35 +77,35 @@ jobs:
# Using 'latest' branch, the latest CMake is installed. # Using 'latest' branch, the latest CMake is installed.
uses: lukka/get-cmake@latest uses: lukka/get-cmake@latest
- name: Ubuntu - install luajit - name: Ubuntu - install opengl lua5.1 luajit
run: | # vcpkg has lua 5.2
sudo apt-get install libluajit-5.1-dev run: sudo apt-get install libglew-dev liblua5.1-0-dev libluajit-5.1-dev
if: contains( matrix.os, 'ubuntu') if: contains( matrix.os, 'ubuntu')
- name: MacOS - install luajit pkgconfig - name: MacOS - install physfs pkgconfig lua5.1 luajit xquartz
run: brew install luajit pkgconfig run: brew install physfs pkgconfig lua@5.1 luajit xquartz
if: contains( matrix.os, 'macos') if: contains( matrix.os, 'macos')
- uses: lukka/set-shell-env@v1 - name: Set Environment vars
with: run: |
CXX: ${{ matrix.cxx }} echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
CC: ${{ matrix.cc }} echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV
- name: Run vcpkg - name: Run vcpkg
uses: lukka/run-vcpkg@v2 uses: lukka/run-vcpkg@v7.1
with: with:
vcpkgArguments: ${{ matrix.packages }} vcpkgArguments: ${{ matrix.packages }}
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/ vcpkgDirectory: ${{ runner.workspace }}/vcpkg/
vcpkgTriplet: ${{ matrix.triplet }} vcpkgTriplet: ${{ matrix.triplet }}
vcpkgGitCommitId: 7db401cb1ef1fc559ec9f9ce814d064c328fd767 vcpkgGitCommitId: 9a49e3df7f729655318c59b9985c9c18ad0c99d6
- name: Build with CMake - name: Build with CMake
uses: lukka/run-cmake@v2 uses: lukka/run-cmake@v3
with: with:
useVcpkgToolchainFile: true
buildDirectory: ${{ runner.workspace }}/build buildDirectory: ${{ runner.workspace }}/build
cmakeBuildType: ${{ matrix.buildtype }} cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeAppendedArgs: -DUSE_LUAJIT=${{ matrix.luajit }} cmakeAppendedArgs: '-G Ninja -DCMAKE_BUILD_TYPE="${{ matrix.buildtype }}" -DLUAJIT="${{ matrix.luajit }}"'
useVcpkgToolchainFile: true
- name: dir - name: dir
run: find $RUNNER_WORKSPACE run: find $RUNNER_WORKSPACE
@ -130,4 +130,4 @@ jobs:
with: with:
name: otclient-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }} name: otclient-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
path: ${{ runner.workspace }}/build/*.dll path: ${{ runner.workspace }}/build/*.dll
if: contains( matrix.os, 'windows') if: contains( matrix.os, 'windows')

View File

@ -148,8 +148,8 @@ else()
set(USE_STATIC_LIBS OFF) set(USE_STATIC_LIBS OFF)
set(USE_LIBCPP ON) set(USE_LIBCPP ON)
endif() endif()
set(BUILD_COMMIT "devel" CACHE "Git commit string (intended for releases)" STRING) set(BUILD_COMMIT "devel" CACHE STRING "Git commit string (intended for releases)")
set(BUILD_REVISION "0" CACHE "Git revision string (intended for releases)" STRING) set(BUILD_REVISION "0" CACHE STRING "Git revision string (intended for releases)")
# default build type # default build type
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
@ -294,15 +294,16 @@ if(FRAMEWORK_THREAD_SAFE)
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DTHREAD_SAFE) set(framework_DEFINITIONS ${framework_DEFINITIONS} -DTHREAD_SAFE)
endif() endif()
set(OpenGL_GL_PREFERENCE "GLVND")
if(FRAMEWORK_GRAPHICS) if(FRAMEWORK_GRAPHICS)
set(OPENGLES "OFF" CACHE "Use OpenGL ES 1.0 or 2.0 (for mobiles devices)" STRING) set(OPENGLES "OFF" CACHE STRING "Use OpenGL ES 1.0 or 2.0 (for mobiles devices)")
if(OPENGLES STREQUAL "2.0") if(OPENGLES STREQUAL "2.0")
find_package(OpenGLES2 REQUIRED) find_package(OpenGLES2 REQUIRED)
find_package(EGL REQUIRED) find_package(EGL REQUIRED)
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DOPENGL_ES=2) set(framework_DEFINITIONS ${framework_DEFINITIONS} -DOPENGL_ES=2)
set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${EGL_INCLUDE_DIR} ${OPENGLES2_INCLUDE_DIR}) set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${EGL_INCLUDE_DIR} ${OPENGLES2_INCLUDE_DIR})
set(framework_LIBRARIES ${framework_LIBRARIES} ${EGL_LIBRARY} ${OPENGLES2_LIBRARY}) set(framework_LIBRARIES ${framework_LIBRARIES} ${EGL_LIBRARY} ${OPENGLES2_LIBRARY})
ELSEif(OPENGLES STREQUAL "1.0") elseif(OPENGLES STREQUAL "1.0")
find_package(OpenGLES1 REQUIRED) find_package(OpenGLES1 REQUIRED)
find_package(EGL REQUIRED) find_package(EGL REQUIRED)
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DOPENGL_ES=1) set(framework_DEFINITIONS ${framework_DEFINITIONS} -DOPENGL_ES=1)

View File

@ -4,7 +4,7 @@
# LUAJIT_LIBRARY - the lua library # LUAJIT_LIBRARY - the lua library
# LUAJIT_LIBRARIES - the lua library and it's dependencies # LUAJIT_LIBRARIES - the lua library and it's dependencies
FIND_PATH(LUAJIT_INCLUDE_DIR NAMES lua.h PATH_SUFFIXES luajit-2.0) FIND_PATH(LUAJIT_INCLUDE_DIR NAMES lua.h PATH_SUFFIXES luajit-2.0 luajit-2.1)
SET(_LUAJIT_STATIC_LIBS libluajit51.a libluajit5.1.a libluajit-5.1.a libluajit.a) SET(_LUAJIT_STATIC_LIBS libluajit51.a libluajit5.1.a libluajit-5.1.a libluajit.a)
SET(_LUAJIT_SHARED_LIBS libluajit51.dll.a libluajit5.1.dll.a libluajit-5.1.dll.a libluajit.dll.a luajit51 luajit5.1 luajit-5.1 luajit) SET(_LUAJIT_SHARED_LIBS libluajit51.dll.a libluajit5.1.dll.a libluajit-5.1.dll.a libluajit.dll.a luajit51 luajit5.1 luajit-5.1 luajit)
IF(USE_STATIC_LIBS) IF(USE_STATIC_LIBS)
@ -14,4 +14,4 @@ ELSE()
ENDIF() ENDIF()
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT DEFAULT_MSG LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT DEFAULT_MSG LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR)
MARK_AS_ADVANCED(LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR) MARK_AS_ADVANCED(LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR)