From ef0c19477c16a71452f0ecf3b5517d13992ef8c4 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 5 Apr 2024 14:11:49 +0200 Subject: [PATCH] Fix HAVE_RECENT_LJ false-positives --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bf849493a..0f06d3f4d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -698,11 +698,13 @@ include(CheckCSourceCompiles) set(CMAKE_REQUIRED_INCLUDES ${LUA_INCLUDE_DIR}) if(USE_LUAJIT) - set(CMAKE_REQUIRED_LIBRARIES ${LUA_LIBRARY}) + # libm usually required if statically linking + set(CMAKE_REQUIRED_LIBRARIES ${LUA_LIBRARY} m) # LuaJIT provides exactly zero ways to determine how recent it is (the version # is unchanged since 2017), however it happens that string buffers were added # after the changes which we care about so that works as an indicator. # (https://github.com/LuaJIT/LuaJIT/commit/4c6b669 March 2021) + # Note: This is no longer true as of August 2023, but we're keeping the old check. unset(HAVE_RECENT_LJ CACHE) check_symbol_exists(luaopen_string_buffer "lualib.h" HAVE_RECENT_LJ) if(NOT HAVE_RECENT_LJ)