Skip to content

Commit

Permalink
Find Luajit on vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
adrido committed Mar 10, 2019
1 parent 95c58cc commit c738afb
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions cmake/Modules/FindLuaJIT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,31 @@ FIND_PATH(LUA_INCLUDE_DIR luajit.h
/opt
)

FIND_LIBRARY(LUA_LIBRARY
NAMES luajit-5.1
HINTS
$ENV{LUA_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
# Test if running on vcpkg toolchain
if(DEFINED VCPKG_TARGET_TRIPLET AND DEFINED VCPKG_APPLOCAL_DEPS)
# On vcpkg luajit is 'lua51' and normal lua is 'lua'
FIND_LIBRARY(LUA_LIBRARY
NAMES lua51
HINTS
$ENV{LUA_DIR}
PATH_SUFFIXES lib
)
else()
FIND_LIBRARY(LUA_LIBRARY
NAMES luajit-5.1
HINTS
$ENV{LUA_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
endif()


IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/luajit.h")
FILE(STRINGS "${LUA_INCLUDE_DIR}/luajit.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"LuaJIT .+\"")
Expand Down

0 comments on commit c738afb

Please sign in to comment.