diff --git a/CMakeLists.txt b/CMakeLists.txt index e4f80c5ad..afc5e6d75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -497,7 +497,7 @@ else() ENDIF() ENDIF() - set(USED_LUA_LIBRARIES ${LUA_LIBRARY}) + set(USED_LUA_LIBRARIES ${LUA_LIBRARIES}) add_dependency_includes(${LUA_INCLUDE_DIR}) # add a target to generate API documentation with Doxygen @@ -776,4 +776,3 @@ foreach(header ${headers_to_check}) endforeach() add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources}) set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir}) - diff --git a/cmake/FindLua.cmake b/cmake/FindLua.cmake index 0973bd187..49b6ae304 100644 --- a/cmake/FindLua.cmake +++ b/cmake/FindLua.cmake @@ -172,12 +172,18 @@ if (LUA_LIBRARY) if (UNIX AND NOT APPLE AND NOT BEOS) find_library(LUA_MATH_LIBRARY m) set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}") + + # include dl library for statically-linked Lua library + get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT) + if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX) + list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS}) + endif() + # For Windows and Mac, don't need to explicitly include the math library else () set(LUA_LIBRARIES "${LUA_LIBRARY}") endif () endif () - include(FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if # all listed variables are TRUE diff --git a/features/step_definitions/data.js b/features/step_definitions/data.js index 99f6a5786..49ca6d7f1 100644 --- a/features/step_definitions/data.js +++ b/features/step_definitions/data.js @@ -245,8 +245,9 @@ module.exports = function () { text += data + '\n'; } else { text += 'local f = assert(io.open("' + lua_profiles_path + '/' + profile + '.lua", "r"))\n'; - text += 'local m = assert(loadstring(f:read("*all") .. [[\n' + data + '\n]]))\n'; + text += 'local s = f:read("*all") .. [[\n' + data + '\n]]\n'; text += 'f:close()\n'; + text += 'local m = assert(loadstring and loadstring(s) or load(s))\n'; text += 'm()\n'; } this.profileFile = this.profileCacheFile;