summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-01-20 16:54:41 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-01-20 16:54:41 (GMT)
commit6b4b8e6a600e177d6bbe41848e7de58e7392c81a (patch)
tree8fd14002235c8badf68718853d3e826d02fa27b2
parentd9d41d332d91abf0da7aa531b64bdecad5b6e9b9 (diff)
parentadc04afe34791a90a552fcaefaf30e24b937e1b3 (diff)
downloadCMake-6b4b8e6a600e177d6bbe41848e7de58e7392c81a.zip
CMake-6b4b8e6a600e177d6bbe41848e7de58e7392c81a.tar.gz
CMake-6b4b8e6a600e177d6bbe41848e7de58e7392c81a.tar.bz2
Merge topic 'add-dl-to-lua-static-linking'
adc04afe FindLua: Add dl library to Lua static library linking
-rw-r--r--Modules/FindLua.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake
index 5be0428..c777970 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -172,6 +172,13 @@ 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}")