Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added libtinfo dependency #33

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lua-5.4.6/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,26 @@ elseif(Win32)
endif()

if(LUA_BUILD_BINARY)
include(CheckIncludeFile)
CHECK_INCLUDE_FILE("readline/readline.h" HAVE_READLINE_READLINE_H)
include(CheckLibraryExists)
CHECK_LIBRARY_EXISTS(tinfo tputs "" HAVE_LIBRARY_TINFO)
if (HAVE_LIBRARY_TINFO)
SET(CMAKE_REQUIRED_LIBRARIES tinfo)
endif()
CHECK_LIBRARY_EXISTS(readline readline "" HAVE_LIBRARY_READLINE)
SET(CMAKE_REQUIRED_LIBRARIES "")

add_executable(lua "src/lua.c")
# Can not use lua_shared because some symbols are not exported
target_link_libraries(lua PRIVATE lua_static)
set_target_properties(lua PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}
)
if (HAVE_READLINE_READLINE_H)
if (HAVE_LIBRARY_READLINE)
target_compile_definitions(lua PRIVATE "LUA_USE_READLINE")
target_link_libraries(lua PUBLIC readline)
if (HAVE_LIBRARY_TINFO)
target_link_libraries(lua PUBLIC tinfo)
endif()
endif()
list(APPEND TARGETS_TO_INSTALL lua)
endif()
Expand Down
Loading