Skip to content

Commit 1c89296

Browse files
authored
Merge pull request #14 from Freed-Wu/build
build
2 parents dfbaa6a + c9f2354 commit 1c89296

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

cmake/LuaNativeObjects.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Lua Native Objects
33
#
44

5-
find_program(LUA_NATIVE_OBJECTS_EXECUTABLE native_objects.lua
5+
find_program(LUA_NATIVE_OBJECTS_EXECUTABLE native_objects
66
PATHS ${CMAKE_SOURCE_DIR}/../LuaNativeObjects
77
DOC "LuaNativeObjects executable path")
88
set(USE_PRE_GENERATED_BINDINGS TRUE CACHE BOOL

git2.nobj.lua

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,15 @@ subfiles {
8585
--
8686
-- Load parsed libgit2 docs.
8787
--
88-
local json = require"json"
8988
local file = io.open("docs/libgit2.json", "r")
90-
local libgit2_docs = json.decode(file:read("*a"))
89+
local text = file:read("*a")
9190
file:close()
92-
93-
local lg_funcs = libgit2_docs.functions
91+
local ok, json = pcall(require, "json")
92+
local lg_funcs = {}
93+
if ok then
94+
local libgit2_docs = json.decode(text)
95+
lg_funcs = libgit2_docs.functions
96+
end
9497

9598
-- Copy docs from libgit2
9699
reg_stage_parser("pre_gen",{

0 commit comments

Comments
 (0)