--- cmake-3.20.6.old/Modules/FindLua.cmake +++ cmake-3.20.6/Modules/FindLua.cmake @@ -211,9 +211,8 @@ if (LUA_LIBRARY) # include the math library for Unix if (UNIX AND NOT APPLE AND NOT BEOS) - find_library(LUA_MATH_LIBRARY m) mark_as_advanced(LUA_MATH_LIBRARY) - set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}") + set(LUA_LIBRARIES "${LUA_LIBRARY};-lm") # include dl library for statically-linked Lua library get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT) --- cmake-3.20.6.old/Modules/FindLua50.cmake +++ cmake-3.20.6/Modules/FindLua50.cmake @@ -72,8 +72,7 @@ if(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua) # include the math library for Unix if(UNIX AND NOT APPLE) - find_library(MATH_LIBRARY_FOR_LUA m) - set( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua};${MATH_LIBRARY_FOR_LUA}" CACHE STRING "This is the concatenation of lua and lualib libraries") + set( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua};${MATH_LIBRARY_FOR_LUA};-lm" CACHE STRING "This is the concatenation of lua and lualib libraries") # For Windows and Mac, don't need to explicitly include the math library else() set( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua}" CACHE STRING "This is the concatenation of lua and lualib libraries") --- cmake-3.20.6.old/Modules/FindLua51.cmake +++ cmake-3.20.6/Modules/FindLua51.cmake @@ -59,8 +59,7 @@ if(LUA_LIBRARY) # include the math library for Unix if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU) - find_library(LUA_MATH_LIBRARY m) - set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries") + set (LUA_LIBRARIES "${LUA_LIBRARY};-lm" CACHE STRING "Lua Libraries") # For Windows and Mac, don't need to explicitly include the math library else() set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")