xpol/lua-rapidjson

question: how to compile `lua-rapidjson` with specified Lua/Luajit version.

membphis opened this issue · 10 comments

I want to compile the lua-rapidjson with specified Luajit, for example:

$ ls /usr/local/openresty/luajit/include/luajit-2.1
lauxlib.h lua.h     lua.hpp   luaconf.h luajit.h  lualib.h

$ ls /usr/local/openresty/luajit/lib
libluajit-5.1.2.1.0.dylib libluajit-5.1.2.dylib     libluajit-5.1.a           libluajit-5.1.dylib       lua                       pkgconfig

How can I implement this? One more thing, I'm working on MAC OSX.

I created an related issue to luarocks right now:

#39

xpol commented

I have update docs here

Hav it a try~

It seems that the option LUA_DIR did not take effect.

$ cmake -H. -Bbuild -G 'Unix Makefiles' -DLUA_DIR=/usr/local/openresty/luajit
-- The C compiler identification is AppleClang 11.0.0.11000020
-- The CXX compiler identification is AppleClang 11.0.0.11000020
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/local/bin/git (found version "2.17.0")
-- LUA_RAPIDJSON_VERSION: v0.5.1-22-g7c4c6f4-dirty
-- Found Lua: /usr/local/lib/liblua5.1.dylib (found version "5.1.5")
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    LUA_DIR

$ fgrep -r "include" ./build/*.txt
./build/CMakeCache.txt:LUA_INCLUDE_DIR:PATH=/usr/local/include/lua5.1
./build/CMakeCache.txt:FIND_PACKAGE_MESSAGE_DETAILS_Lua:INTERNAL=[/usr/local/lib/liblua5.1.dylib][/usr/local/include/lua5.1][v5.1.5()]
xpol commented

failed again , here is the log:

$ cmake ../ -DLUA_DIR=/usr/local/openresty/luajit
-- The C compiler identification is AppleClang 11.0.0.11000020
-- The CXX compiler identification is AppleClang 11.0.0.11000020
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/local/bin/git (found version "2.17.0")
-- LUA_RAPIDJSON_VERSION: v0.5.1-22-g7c4c6f4-dirty
-- Found Lua: /usr/local/lib/liblua5.1.dylib (found version "5.1.5")
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    LUA_DIR


-- Build files have been written to: /Users/rain/Downloads/lua-rapidjson/build
xpol commented

I mean LUA_DIR=/usr/local/openresty/luajit cmake -H. -Bbuild -G 'Unix Makefiles'

it works fine for me: luarocks install --lua-dir=/usr/local/openresty/luajit rapidjson

and it works fine too: LUA_DIR=/usr/local/openresty/luajit cmake -H. -Bbuild -G 'Unix Makefiles'

thx for your help. @xpol

we should update the readme doc.

many thx for your great job.