openresty / lua-cjson

Lua CJSON is a fast JSON encoding/parsing module for Lua
http://www.kyne.com.au/~mark/software/lua-cjson.php
MIT License
436 stars 119 forks source link

Error: Could NOT find Lua51 (missing: LUA_INCLUDE_DIR) when runtests.sh #58

Closed NagamineLee closed 2 years ago

NagamineLee commented 4 years ago

I try to run test, using openresty luajit and luarocks

but cmake occurs exception:

===== Testing Cmake build ===== -- The C compiler identification is GNU 4.8.5 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done CMake Error at /usr/local/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message): Could NOT find Lua51 (missing: LUA_INCLUDE_DIR) Call Stack (most recent call first): /usr/local/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE) /usr/local/share/cmake-3.0/Modules/FindLua51.cmake:94 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:18 (find_package)

-- Configuring incomplete, errors occurred!

so tests' running must required Lua5.1?

leafo commented 2 years ago

cmake is currently hardocded to lua 5.1. I recommend just using make if you want to build it, it's suitable for building to run the test suite. See the test workflow here: https://github.com/openresty/lua-cjson/blob/master/.github/workflows/test.yml