lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Tue, Jul 20, 2021 at 7:06 PM Hugo Musso Gualandi <hgualandi@inf.puc-rio.br> wrote:
CMake is certainly an interesting suggestion, which I hadn't thought
about!

However, I have to wonder... If we're reaching for a tool specifically
to build Lua extension modules, shouldn't this be an ideal job for
Luarocks?

I just don't know if there is a way to invoke it without the cerimony
of creating a rockspec. Which by the way, is a question I also have
about CMake. Is there a way to compile something without a CMakeLists
file?

-- Hugo


 Hi,

Vinicius Jarina shared his cross platform cmake file last year. I have been using it very successfully for multiple platforms (Windows, Linux, Mac and FreeBSD) and also for cross platform compilation by using the -DCMAKE_TOOLCHAIN_FILE cmake option (Linux with llvm-mingw cross compiler). 

http://lua-users.org/lists/lua-l/2020-05/msg00524.html

Incidentally, I am compiling on Windows with my WinLua toolchain, which uses an llvm-mingw compiler. Currently at llvm 11, the compiler supports both GNU and MS cl style compiler options. http://winlua.net

Another much more appealing option than CMake is a wonderful build tool called XMake. Xmake is a *lua* based, cross platform build tool. In my opinion it is much better than cmake and is as fast as cmake + ninja. I have used it to successfully compile on Linux and Windows a number of times, but mostly with small libraries (I've built some larger libraries on Linux, but not windows). A slightly outdated version of xmake is also included with WinLua Toolchain. https://xmake.io/#/


Regards,
Russ