neovim/cmake/FindLuajit.cmake
dundargoc c50951a4d0
build: various fixes
- simplify lua interpreter search
- fix incorrect variable name in BuildLua.cmake
- build PUC Lua with -O2
- silence non-mandatory find_package search for libuv
- simplify Find modules
- Prefer using the explicitly set CI_BUILD over relying on the
  environment variable "CI".
2023-09-04 00:00:26 +02:00

18 lines
466 B
CMake

find_path(LUAJIT_INCLUDE_DIR luajit.h
PATH_SUFFIXES luajit-2.1)
if(MSVC)
list(APPEND LUAJIT_NAMES lua51)
elseif(MINGW)
list(APPEND LUAJIT_NAMES libluajit libluajit-5.1)
else()
list(APPEND LUAJIT_NAMES luajit-5.1)
endif()
find_library(LUAJIT_LIBRARY NAMES ${LUAJIT_NAMES})
find_package_handle_standard_args(Luajit DEFAULT_MSG
LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR)
mark_as_advanced(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARY)