From 03c3f7887dbc26c4246ea2eeb135453f3f3ee000 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 12 Nov 2023 22:04:15 +0100 Subject: [PATCH] build: enforce PREFER_LUA Only search for luajit if PREFER_LUA=OFF. If PREFER_LUA is OFF, then always prioritize luajit first and then fall back to lua. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bcfac39098..b57e55f938 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,7 +168,10 @@ foreach(CFGNAME ${CMAKE_CONFIGURATION_TYPES}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib) endforeach() -find_program(LUA_PRG NAMES luajit lua5.1 lua5.2 lua) +if(NOT PREFER_LUA) + find_program(LUA_PRG NAMES luajit) +endif() +find_program(LUA_PRG NAMES lua5.1 lua5.2 lua) if(NOT LUA_PRG) message(FATAL_ERROR "Failed to find a Lua 5.1-compatible interpreter") endif()