Merge #8044 'build: improve Lua module checks'

This commit is contained in:
Justin M. Keyes 2018-02-22 09:38:10 +01:00 committed by GitHub
commit 8c8cf46c71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,9 +4,8 @@
# 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}')"
RESULT_VARIABLE module_missing
ERROR_QUIET)
execute_process(COMMAND ${LUA_PRG_PATH} -l "${MODULE}" -e ""
RESULT_VARIABLE module_missing)
if(module_missing)
set(${RESULT_VAR} False PARENT_SCOPE)
else()