project(luajit C)

set(LUA_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/deps/luajit/src)
set(LUA_LIBRARY ${PROJECT_SOURCE_DIR}/deps/luajit/src/libluajit.a)
set(LUA_DEPEND external_lualib)

set(LUA_DEPEND_CLEAN make -C ${PROJECT_SOURCE_DIR}/deps/luajit clean)

add_custom_target(${LUA_DEPEND}
    COMMAND make CFLAGS="-fPIC"
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/deps/luajit
)