From ef0a07c073665c0868294fcc73b1344aca62b133 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 22 Feb 2018 01:22:26 +0100 Subject: [PATCH] cmake/LuaHelpers.cmake: check_lua_module: use 'lua -l' It only shortens the traceback a bit for when a module is not found though, only removing the "(command line):1: in main chunk" (with lua5.2). --- cmake/LuaHelpers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/LuaHelpers.cmake b/cmake/LuaHelpers.cmake index a401ff75df..3cba47412b 100644 --- a/cmake/LuaHelpers.cmake +++ b/cmake/LuaHelpers.cmake @@ -4,7 +4,7 @@ # Check if a module is available in Lua function(check_lua_module LUA_PRG_PATH MODULE RESULT_VAR) - execute_process(COMMAND ${LUA_PRG_PATH} -e "require('${MODULE}')" + execute_process(COMMAND ${LUA_PRG_PATH} -l "${MODULE}" -e "" RESULT_VARIABLE module_missing) if(module_missing) set(${RESULT_VAR} False PARENT_SCOPE)