q66 / cffi-lua

A portable C FFI for Lua 5.1+
MIT License
176 stars 24 forks source link

Build with prebuilt Lua Version #43

Open aryajur opened 9 months ago

aryajur commented 9 months ago

I am trying to build with a pre-build Lua version. meson was not able to find my Lua version. I then defined a lua.pc file:

` prefix=/path/to/my/lua exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/inc

Name: lua Description: Lua programming language Version: 5.3 Libs: -L${libdir} -llua Cflags: -I${includedir} `

I then get the following error:

Found pkg-config: C:\msys64\mingw32\bin/pkg-config.EXE (1.8.0) Found CMake: C:\msys64\mingw32\bin/cmake.EXE (3.25.1) Run-time dependency lua5.3 found: NO (tried pkgconfig and cmake) Run-time dependency lua-5.3 found: NO (tried pkgconfig and cmake) Run-time dependency lua53 found: NO (tried pkgconfig and cmake) Run-time dependency lua found: YES 5.3 Run-time dependency libffi found: YES 3.4.4 Library dl found: NO Computing int of "LUA_VERSION_NUM" with dependency lua: 503 Library lua found: NO Library lua5.3 found: NO

../meson.build:144:8: ERROR: C++ shared or static library 'lua53' not found

the libdir already has lua53.dll file in there. After I renamed lua53.dll to lua.dll then that worked. But now it was not able to find the executable Lua.

So I made the deps subdirectory and put the lua53 executable and dll in there with all the include files in the deps/include subdirectory. Then I ran the command:

meson .. -Dlua_version=5.3 -Dlua_path=/path/to/cffi-lua-0.2.3/build/deps/lua.exe

that worked!

Now when I run ninja I get all fatal errors that it cannot find lua.hpp.

So I had to manually edit build.ninja to add the "-Ideps/include" term in the commands. After that it worked.