From e37e3a34e4d0e9ffdb3537f3ec4aa835457ab03c Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Wed, 26 Nov 2025 10:42:17 +0800 Subject: [PATCH 1/2] rename luanativeobjects executable file name According to https://luarocks.org/modules/neopallium/luanativeobjects the executable file name of luanativeobjects is native_objects not native_objects.lua --- cmake/LuaNativeObjects.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/LuaNativeObjects.cmake b/cmake/LuaNativeObjects.cmake index d7a090a..560507b 100644 --- a/cmake/LuaNativeObjects.cmake +++ b/cmake/LuaNativeObjects.cmake @@ -2,7 +2,7 @@ # Lua Native Objects # -find_program(LUA_NATIVE_OBJECTS_EXECUTABLE native_objects.lua +find_program(LUA_NATIVE_OBJECTS_EXECUTABLE native_objects PATHS ${CMAKE_SOURCE_DIR}/../LuaNativeObjects DOC "LuaNativeObjects executable path") set(USE_PRE_GENERATED_BINDINGS TRUE CACHE BOOL From c9f235402da6d1fab25a23ae2f052dd7c7b5741d Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Wed, 26 Nov 2025 10:44:32 +0800 Subject: [PATCH 2/2] let json be an optional dependency if user `cmake -Bbuild -DGENERATE_LUADOCS=OFF`, `require"json"` is not necessary --- git2.nobj.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/git2.nobj.lua b/git2.nobj.lua index 318c07b..3a202f9 100644 --- a/git2.nobj.lua +++ b/git2.nobj.lua @@ -85,12 +85,15 @@ subfiles { -- -- Load parsed libgit2 docs. -- -local json = require"json" local file = io.open("docs/libgit2.json", "r") -local libgit2_docs = json.decode(file:read("*a")) +local text = file:read("*a") file:close() - -local lg_funcs = libgit2_docs.functions +local ok, json = pcall(require, "json") +local lg_funcs = {} +if ok then + local libgit2_docs = json.decode(text) + lg_funcs = libgit2_docs.functions +end -- Copy docs from libgit2 reg_stage_parser("pre_gen",{