Skip to content

Commit

Permalink
Merge pull request orbitersim#458 from TheGondos/lua_ldoc
Browse files Browse the repository at this point in the history
[Lua]Update API documentation
  • Loading branch information
jarmonik authored May 14, 2024
2 parents 3c336b1 + 8cf6f2c commit 2ab9370
Show file tree
Hide file tree
Showing 370 changed files with 86,658 additions and 602 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ set(HTMLHELP_LIB_DIR ${HTMLHELP_DIR}/lib-${ARCH})
set(HTMLHELP_LIB ${HTMLHELP_LIB_DIR}/Htmlhelp.lib)

set(ORBITER_TOOL_MESHC "$<TARGET_FILE:meshc>")
set(ldoc $<TARGET_FILE:lua::exe> ${LUA_DIR}/packages/LDoc/ldoc.lua)
set(ldoc $<TARGET_FILE:lua_bin> ${ORBITER_BINARY_ROOT_DIR}/packages/LDoc/ldoc.lua -v --multimodule)

find_package(OpenGL QUIET)
find_package(HTMLHelp)
Expand Down
46 changes: 45 additions & 1 deletion Extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ project(Extern)
## Lua

file(GLOB LUA_FILES "Lua/*.c" "Lua/*.h")

list(REMOVE_ITEM LUA_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Lua/lua.c)
list(REMOVE_ITEM LUA_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Lua/luac.c)
list(REMOVE_ITEM LUA_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Lua/print.c)
add_library(lua SHARED ${LUA_FILES})
target_compile_definitions(lua PUBLIC LUA_BUILD_AS_DLL)

Expand All @@ -17,6 +19,48 @@ set_target_properties(lua PROPERTIES

install(TARGETS lua RUNTIME DESTINATION ${ORBITER_INSTALL_ROOT_DIR})
install(TARGETS lua DESTINATION ${ORBITER_INSTALL_SDK_DIR}/lib/Lua)
install(TARGETS lua DESTINATION ${ORBITER_INSTALL_SDK_DIR}/Utils/)


add_executable(lua_bin
${LUA_FILES} "Lua/lua.c"
)
set_target_properties(lua_bin
PROPERTIES
OUTPUT_NAME lua
)
set_target_properties(lua_bin PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${ORBITER_BINARY_ROOT_DIR}
LIBRARY_OUTPUT_DIRECTORY ${ORBITER_BINARY_ROOT_DIR}
RUNTIME_OUTPUT_DIRECTORY ${ORBITER_BINARY_ROOT_DIR}
)

install(TARGETS lua_bin
DESTINATION ${ORBITER_BINARY_ROOT_DIR}
)
install(TARGETS lua_bin DESTINATION ${ORBITER_INSTALL_SDK_DIR}/Utils/)

## LFS
add_library(lfs SHARED luafilesystem/src/lfs.c)
install(TARGETS lfs DESTINATION ${ORBITER_BINARY_ROOT_DIR})
install(TARGETS lfs DESTINATION ${ORBITER_INSTALL_SDK_DIR}/Utils/)
target_include_directories(lfs PUBLIC Lua)
target_link_libraries(lfs lua)
SET_TARGET_PROPERTIES(lfs PROPERTIES LINK_FLAGS "/DEF:\"${CMAKE_CURRENT_SOURCE_DIR}/luafilesystem/src/lfs.def\""
)
install(TARGETS lfs
DESTINATION ${ORBITER_BINARY_ROOT_DIR}
)
set_target_properties(lfs PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${ORBITER_BINARY_ROOT_DIR}
LIBRARY_OUTPUT_DIRECTORY ${ORBITER_BINARY_ROOT_DIR}
RUNTIME_OUTPUT_DIRECTORY ${ORBITER_BINARY_ROOT_DIR}
)

add_custom_target(CopyLDoc ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/ldoc/ ${ORBITER_BINARY_ROOT_DIR}/packages/ldoc
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Penlight/lua/ ${ORBITER_BINARY_ROOT_DIR}/
)

##########################################
## zlib
Expand Down
8 changes: 8 additions & 0 deletions Extern/Penlight/.busted
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
return {
default = {
verbose = true,
output = "gtest",
lpath = "./lua/?.lua;./lua/?/init.lua",
}
}
-- vim: ft=lua
22 changes: 22 additions & 0 deletions Extern/Penlight/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[*.lua]
indent_style = space
indent_size = 2

[kong/templates/nginx*]
indent_style = space
indent_size = 4

[*.template]
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab
2 changes: 2 additions & 0 deletions Extern/Penlight/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
luacov.stats.out
*.rock
40 changes: 40 additions & 0 deletions Extern/Penlight/.luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
unused_args = false
redefined = false
max_line_length = false

globals = {
"ngx",
}

not_globals = {
"string.len",
"table.getn",
}

include_files = {
"**/*.lua",
"*.rockspec",
".busted",
".luacheckrc",
}

files["spec/**/*.lua"] = {
std = "+busted",
}

exclude_files = {
"tests/*.lua",
"tests/**/*.lua",
-- Travis Lua environment
"here/*.lua",
"here/**/*.lua",
-- GH Actions Lua Environment
".lua",
".luarocks",
".install",

-- TODO: fix these files
"examples/symbols.lua",
"examples/test-symbols.lua",
}

4 changes: 4 additions & 0 deletions Extern/Penlight/.luacov
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
modules = {
["pl"] = "lua/pl/init.lua",
["pl.*"] = "lua"
}
Loading

0 comments on commit 2ab9370

Please sign in to comment.