diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b62ca8556..2c2587ec0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -543,6 +543,24 @@ endif() message(STATUS "Using Lua interpreter: ${LUA_PRG}") +if(NOT WIN32) + if(PREFER_LUA) + foreach(CURRENT_LUAC_PRG luac5.1 luac) + find_program(_CHECK_LUAC_PRG ${CURRENT_LUAC_PRG}) + if(_CHECK_LUAC_PRG) + set(LUAC_PRG "${_CHECK_LUAC_PRG} -s -o - %s" CACHE STRING "Format for compiling to Lua bytecode") + break() + endif() + endforeach() + elseif(LUA_PRG MATCHES "luajit") + set(LUAC_PRG "${LUA_PRG} -b -s %s -" CACHE STRING "Format for compiling to Lua bytecode") + endif() +endif() + +if(LUAC_PRG) + message(STATUS "Using Lua compiler: ${LUAC_PRG}") +endif() + # Setup busted. find_program(BUSTED_PRG NAMES busted busted.bat) find_program(BUSTED_LUA_PRG busted-lua) |