SoapySDR
SoapySDR copied to clipboard
Build issues when enabling docs for LuaJIT (on Windows) - LDoc missing dependence
I decided to try building with all the docs.
So checking the build we see that LuaJIT is asking to use the LDoc (among several others), not mentioned elsewhere here.
Looking in to the file ..\luajit\docs\CMakeLists.txt we find that there is some confusion for the Windows build, in addition to not informing user about this.
https://github.com/pothosware/SoapySDR/blob/master/luajit/docs/CMakeLists.txt#L27-L34
# TODO: is "." cross-platform?
set(LDOC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doc)
add_custom_command(
OUTPUT ${LDOC_OUTPUT_DIR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../apps ${CMAKE_CURRENT_BINARY_DIR}/config.ld
COMMAND ${LDOC_EXECUTABLE} .
COMMENT "Generating LuaJIT documentation with LDoc")
add_custom_target(ldoc_docs ALL DEPENDS ${LDOC_OUTPUT_DIR})
Thus is seem that these documents are can not be built correctly.
Looking into trying to get LDoc installed seem like royal PITA! Several obscure and badly documented dependencies.
You need to:
#--------------------------------------------
# Install LuaUnit - a LuaJIT dependency
#--------------------------------------------
# git clone [email protected]:bluebird75/luaunit.git
git clone --depth 1 https://github.com/bluebird75/luaunit
cd luaunit
# Then copy the file "luaunit.lua" into your project or the `./lua/` "libs" directory.
# https://github.com/bluebird75/luaunit/issues/165
cp .\luaunit.lua C:\xxx\LuaJIT\lua\.
#--------------------------------------------
# Install LDoc - a LuaJIT dependency
#--------------------------------------------
# But depends on:
https://github.com/luarocks/luarocks/
https://github.com/lunarmodules/Penlight
https://github.com/lunarmodules/luafilesystem
# (a) Install The lua "package manager" ?
https://github.com/luarocks/luarocks/
git clone https://github.com/luarocks/luarocks/
# (b) Install luafilesystem
luarocks install luafilesystem
# (c) Install penlight
luarocks install penlight
# copy "lua/pl" directory into your Lua module path.
# It's typically "C:\Program Files\Lua\5.x\lua" for Lua for Windows.
# (d) Install LDoc
https://github.com/lunarmodules/ldoc
#luarocks install --tree c:/lua ldoc
luarocks install ldoc
PS. I haven't had time to jump through all these steps yet, but all this need to be documented here somewhere.