diff --git a/.github/workflows/build-vcpkg.yml b/.github/workflows/build-vcpkg.yml index 0c036379..e3d6d6f0 100644 --- a/.github/workflows/build-vcpkg.yml +++ b/.github/workflows/build-vcpkg.yml @@ -38,15 +38,15 @@ jobs: cc: cl.exe triplet: x64-windows packages: > - boost-iostreams boost-asio boost-system boost-variant boost-lockfree luajit glew - boost-filesystem boost-uuid physfs openal-soft libogg libvorbis zlib opengl + boost-iostreams boost-asio boost-system boost-variant boost-lockfree glew + boost-filesystem boost-uuid physfs openal-soft libogg lua luajit libvorbis zlib opengl - name: ubuntu-gcc os: ubuntu cxx: g++ cc: gcc triplet: x64-linux 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 - name: ubuntu-clang os: ubuntu @@ -54,7 +54,7 @@ jobs: cc: clang triplet: x64-linux 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 - name: macos-clang os: macos @@ -62,8 +62,8 @@ jobs: cc: clang triplet: x64-osx packages: > - boost-iostreams boost-asio boost-system boost-variant boost-lockfree luajit glew - boost-filesystem boost-uuid physfs openal-soft libogg libvorbis zlib opengl + boost-iostreams boost-asio boost-system boost-variant boost-lockfree glew + boost-filesystem boost-uuid openal-soft libogg libvorbis zlib opengl steps: - uses: actions/checkout@v2 @@ -77,35 +77,35 @@ jobs: # Using 'latest' branch, the latest CMake is installed. uses: lukka/get-cmake@latest - - name: Ubuntu - install luajit - run: | - sudo apt-get install libluajit-5.1-dev + - name: Ubuntu - install opengl lua5.1 luajit + # vcpkg has lua 5.2 + run: sudo apt-get install libglew-dev liblua5.1-0-dev libluajit-5.1-dev if: contains( matrix.os, 'ubuntu') - - name: MacOS - install luajit pkgconfig - run: brew install luajit pkgconfig + - name: MacOS - install physfs pkgconfig lua5.1 luajit xquartz + run: brew install physfs pkgconfig lua@5.1 luajit xquartz if: contains( matrix.os, 'macos') - - uses: lukka/set-shell-env@v1 - with: - CXX: ${{ matrix.cxx }} - CC: ${{ matrix.cc }} + - name: Set Environment vars + run: | + echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV + echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV - name: Run vcpkg - uses: lukka/run-vcpkg@v2 + uses: lukka/run-vcpkg@v7.1 with: vcpkgArguments: ${{ matrix.packages }} vcpkgDirectory: ${{ runner.workspace }}/vcpkg/ vcpkgTriplet: ${{ matrix.triplet }} - vcpkgGitCommitId: 7db401cb1ef1fc559ec9f9ce814d064c328fd767 + vcpkgGitCommitId: 9a49e3df7f729655318c59b9985c9c18ad0c99d6 - name: Build with CMake - uses: lukka/run-cmake@v2 + uses: lukka/run-cmake@v3 with: - useVcpkgToolchainFile: true buildDirectory: ${{ runner.workspace }}/build - cmakeBuildType: ${{ matrix.buildtype }} - cmakeAppendedArgs: -DUSE_LUAJIT=${{ matrix.luajit }} + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeAppendedArgs: '-G Ninja -DCMAKE_BUILD_TYPE="${{ matrix.buildtype }}" -DLUAJIT="${{ matrix.luajit }}"' + useVcpkgToolchainFile: true - name: dir run: find $RUNNER_WORKSPACE @@ -130,4 +130,4 @@ jobs: with: name: otclient-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }} path: ${{ runner.workspace }}/build/*.dll - if: contains( matrix.os, 'windows') \ No newline at end of file + if: contains( matrix.os, 'windows') diff --git a/src/framework/CMakeLists.txt b/src/framework/CMakeLists.txt index f116820e..d5ef1e2a 100644 --- a/src/framework/CMakeLists.txt +++ b/src/framework/CMakeLists.txt @@ -148,8 +148,8 @@ else() set(USE_STATIC_LIBS OFF) set(USE_LIBCPP ON) endif() -set(BUILD_COMMIT "devel" CACHE "Git commit string (intended for releases)" STRING) -set(BUILD_REVISION "0" CACHE "Git revision string (intended for releases)" STRING) +set(BUILD_COMMIT "devel" CACHE STRING "Git commit string (intended for releases)") +set(BUILD_REVISION "0" CACHE STRING "Git revision string (intended for releases)") # default build type if(NOT CMAKE_BUILD_TYPE) @@ -294,15 +294,16 @@ if(FRAMEWORK_THREAD_SAFE) set(framework_DEFINITIONS ${framework_DEFINITIONS} -DTHREAD_SAFE) endif() +set(OpenGL_GL_PREFERENCE "GLVND") 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") find_package(OpenGLES2 REQUIRED) find_package(EGL REQUIRED) set(framework_DEFINITIONS ${framework_DEFINITIONS} -DOPENGL_ES=2) set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${EGL_INCLUDE_DIR} ${OPENGLES2_INCLUDE_DIR}) 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(EGL REQUIRED) set(framework_DEFINITIONS ${framework_DEFINITIONS} -DOPENGL_ES=1) diff --git a/src/framework/cmake/FindLuaJIT.cmake b/src/framework/cmake/FindLuaJIT.cmake index c65886cf..6706aef4 100644 --- a/src/framework/cmake/FindLuaJIT.cmake +++ b/src/framework/cmake/FindLuaJIT.cmake @@ -4,7 +4,7 @@ # LUAJIT_LIBRARY - the lua library # 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_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) @@ -14,4 +14,4 @@ ELSE() ENDIF() INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT DEFAULT_MSG LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR) -MARK_AS_ADVANCED(LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR) \ No newline at end of file +MARK_AS_ADVANCED(LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR)