fix lua and luajit conflict

This commit is contained in:
Sergwest 2024-03-20 22:38:41 +03:00
parent 1571d9c73b
commit c80d96a5ed
3 changed files with 13 additions and 6 deletions

View File

@ -82,6 +82,8 @@ find_package(GLEW REQUIRED)
find_package(OpenAL REQUIRED)
find_package(ZLIB REQUIRED)
set(LIBS "")
if (WIN32)
if(VOXELENGINE_BUILD_WINDOWS_VCPKG)
set(LUA_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/lib/lua51.lib")
@ -99,8 +101,9 @@ if (WIN32)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/glfw)
endif()
else()
# luajit has no CMakeLists.txt to use it as subdirectory, so install it manually
find_package(Lua REQUIRED)
find_package(PkgConfig)
pkg_check_modules(LUAJIT REQUIRED luajit)
set(LUA_LIBRARIES ${LUAJIT_LIBRARIES})
find_package(PNG REQUIRED)
set(PNGLIB PNG::PNG)
set(VORBISLIB vorbis vorbisfile)
@ -110,8 +113,6 @@ if (APPLE)
find_package(glfw3 3.3 REQUIRED)
endif ()
set(LIBS "")
if(UNIX)
find_package(Threads REQUIRED)
set(LIBS ${LIBS} Threads::Threads)

View File

@ -50,12 +50,12 @@ sudo dnf install glfw-devel glfw glew-devel glm-devel libpng-devel libvorbis-dev
#### Arch-based distro:
If you use X11
```sh
sudo pacman -S glfw-x11 glew glm libpng libvorbis openal
sudo pacman -S glfw-x11 glew glm libpng libvorbis openal lua
```
If you use Wayland
```sh
sudo pacman -S glfw-wayland glew glm libpng libvorbis openal
sudo pacman -S glfw-wayland glew glm libpng libvorbis openal lua
```
\+ install LuaJIT

View File

@ -1,7 +1,13 @@
#ifndef LOGIC_SCRIPTING_LUA_H_
#define LOGIC_SCRIPTING_LUA_H_
#ifdef __linux__
#include <lua/lua.hpp>
#undef luaconf_h
#include <luaconf.h>
#else
#include <lua.hpp>
#endif
#include <exception>
namespace lua {