Skip to content

Add support for lua5.4 in FindLua.cmake#5981

Merged
mjjbell merged 1 commit intoProject-OSRM:masterfrom
ijleesw:seok/lua5.4
Jul 20, 2021
Merged

Add support for lua5.4 in FindLua.cmake#5981
mjjbell merged 1 commit intoProject-OSRM:masterfrom
ijleesw:seok/lua5.4

Conversation

@ijleesw
Copy link
Copy Markdown
Contributor

@ijleesw ijleesw commented Mar 12, 2021

Issue

#5980

This PR resolves the problem that cmake fails to find lua5.4.

$ cmake ..
(...)
-- Using Lua 5.4.2
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Using ccache to speed up incremental builds
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/user/maps/osrm-ijleesw/cmake-build-debug

Tasklist

Requirements / Relations

Link any requirements here. Other pull requests this PR is based on?

@mjjbell
Copy link
Copy Markdown
Member

mjjbell commented Mar 14, 2021

The vendored version of sol2 is v2.20.6. It looks like Lua 5.4 support was added in a later version.

However, #5927 modified the vendored version for OSRM to work with Lua 5.4. @OgreTransporter, maybe you can clarify compatibility with 5.4?

Copy link
Copy Markdown
Contributor

@OgreTransporter OgreTransporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#5927 is working with 5.4.3. Unfortunately I don't use the find method because I always pass the libraries directly to CMake. But I have tested FindLua.cmake with Lua 5.4.3.

# this is a function only to have all the variables inside go away automatically
function(_lua_set_version_vars)
set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
set(LUA_VERSIONS5 5.4 5.3 5.2 5.1 5.0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm the PR is working:

D:\OSRM\test\build>SET LUA_DIR=D:\OSRM\deps\lua\install

D:\OSRM\test\build>cmake ..
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042.
-- The C compiler identification is MSVC 19.29.30038.1
-- The CXX compiler identification is MSVC 19.29.30038.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Lua: D:/OSRM/deps/lua/install/lib/lua.lib (found suitable version "5.4.3", minimum required is "5.2")
-- Using Lua 5.4.3
-- Configuring done
-- Generating done
-- Build files have been written to: D:/OSRM/test/build

Test:

cmake_minimum_required(VERSION 3.1)

project(osrm-lua-test)

find_package(Lua 5.2 REQUIRED)
if (LUA_FOUND)
    message(STATUS "Using Lua ${LUA_VERSION_STRING}")
endif()

@mjjbell mjjbell merged commit dca35dc into Project-OSRM:master Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants