Fail awesome compilation for Lua5.4 or newer (#3324)

Awesome doesn't support these versions. Preventing the project from
compiling with it saves the users some very frustrating and hard to
debug bugs.

The cmake version check is redundant with the version check in luaa.h.
Nevertheless, adding it allows to fail the project build sooner and
provides better user experience.

Fixes: #3324

Signed-off-by: Shay Agroskin <agrosshay@gmail.com>
This commit is contained in:
Shay Agroskin 2021-04-13 23:49:50 +03:00 committed by Shay Agroskin
parent fda950d186
commit 3f4b1bd0cc
2 changed files with 11 additions and 0 deletions

View File

@ -71,6 +71,13 @@ if (NOT LUA_FOUND)
"You might want to hint it using the LUA_DIR environment variable, "
"or set the LUA_INCLUDE_DIR / LUA_LIBRARY CMake variables.")
endif()
set(LUA_FULL_VERSION "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
if(LUA_FULL_VERSION VERSION_EQUAL 5.4.0 OR LUA_FULL_VERSION VERSION_GREATER 5.4.0 )
message(FATAL_ERROR "Awesome doesn't support Lua versions newer than 5.3, please refer to"
"https://awesomewm.org/apidoc/documentation/10-building-and-testing.md.html#Building")
endif()
# }}}
# {{{ Check if documentation can be build

4
luaa.h
View File

@ -31,6 +31,10 @@
#include "common/lualib.h"
#include "common/luaclass.h"
#if LUA_VERSION_NUM > 503
print("Awesome doesn't support Lua versions newer than 5.3, please refer to https://awesomewm.org/apidoc/documentation/10-building-and-testing.md.html#Building")
#endif
#define luaA_deprecate(L, repl) \
do { \
luaA_warn(L, "%s: This function is deprecated and will be removed, see %s", \