Fix: ensure we include the right Lua header files (#7842)

#### Brief overview of PR changes/additions
For Windows builds modify the `#include` lines for Lua header files to
specify the 5.1 version. Also accommodate some changes in our CI build
environment:
* For some reason (maybe because of a more modern linker) we need to
specify the original PCRE library with `-lpcre` rather than `-lpcre-1` -
the exact cause of this is not clear but thanks to @jmckisson for
finding it (and using it in his attempt to solve the same problems this
PR is doing).
* It seems the Window building is now being done in the `C:` drive
rather than the previous `D:` one, so a tweak to clean the colon
containing file-system root specifier to the alternative that
MSYS2+Mingw-w64 uses which instead uses a (POSIX) `/` root directory
followed by a single lower-case letter to specify the drive needs to be
extended to handle both drives. This is because the scripts use `rsync`
and that treats any `:` as the separator between host and path and gets
confused when it sees a "Windows" path containing it!

#### Motivation for adding to Mudlet
The default version - and the one needed for some packages like Luarocks
is a 5.4 one - and that includes header files in the "default" `include`
directory. So the headers that get pulled in are the wrong ones, which
fail to work as they are not compatible with Lua 5.1; to get the 5.1
instead I believe we need to explicitly include the version specific
sub-directory in the `#include` lines.

Other tweaks are also needed "to get things working nowadays."

#### Other info (issues closed, discussion etc)
This should be simpler to do than what is being attempted by #7841.

---------

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
This commit is contained in:
Stephen Lyons 2025-05-17 22:34:05 +01:00 committed by GitHub
parent 1d6cec740f
commit 033db9553c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 80 additions and 64 deletions

View file

@ -23,11 +23,18 @@
#include <QtTest/QtTest>
extern "C" {
#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
#if defined(INCLUDE_VERSIONED_LUA_HEADERS)
#include <lua5.1/lauxlib.h>
#include <lua5.1/lua.h>
#include <lua5.1/lualib.h>
#else
#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
#endif
}
class TVarTest : public QObject {
Q_OBJECT