Fix linking to libdl on Ubuntu

This commit is contained in:
Alex Grant Benedict 2021-11-28 17:36:22 -07:00
parent 9ae28de03e
commit 2b9d66b787
2 changed files with 4 additions and 4 deletions

View file

@ -48,8 +48,8 @@ add_executable(lua51 "${LUA_SRC}" "${LUA_LIB_SRC}")
if(UNIX)
target_compile_definitions(lua51_static PUBLIC "LUA_USE_DLOPEN")
target_compile_definitions(lua51 PUBLIC "LUA_USE_DLOPEN")
target_link_libraries(lua51 PUBLIC dl)
target_link_libraries(lua51_static PUBLIC dl)
target_link_libraries(lua51 PUBLIC ${CMAKE_DL_LIBS})
target_link_libraries(lua51_static PUBLIC ${CMAKE_DL_LIBS})
endif()
set_target_properties(lua51_static PROPERTIES LINKER_LANGUAGE CXX)

View file

@ -23,8 +23,8 @@ tolua_to.c
add_library(toluapp51 STATIC "${TOLUA_LIB_SRC}")
add_executable(toluapp "${TOLUA_BIN_SRC}" "${TOLUA_LIB_SRC}")
target_link_libraries(toluapp51 PUBLIC "${PROJECT_BINARY_DIR}/liblua51.a")
target_link_libraries(toluapp PUBLIC "${PROJECT_BINARY_DIR}/liblua51.a")
target_link_libraries(toluapp51 PUBLIC "${PROJECT_BINARY_DIR}/liblua51.a" ${CMAKE_DL_LIBS})
target_link_libraries(toluapp PUBLIC "${PROJECT_BINARY_DIR}/liblua51.a" ${CMAKE_DL_LIBS})
add_custom_command(TARGET toluapp51 POST_BUILD COMMAND cp "${PROJECT_SOURCE_DIR}/toluapp-simple/tolua++.h" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})