mirror of
https://github.com/walterschell/Lua.git
synced 2024-11-22 13:14:35 +00:00
modified check for readline and tinfo
- switched from CHECK_INCLUDE_FILE to CHECK_LIBRARY_EXISTS fixes detection issue of readline on archlinux due to missing imports (unknown type FILE) - discovering tinfo using CHECK_LIBRARY_EXISTS the result is used in the discovery of readline as the same error as discussed in walterschell/Lua#32 prevented the detection of readline
This commit is contained in:
parent
81f47ed7e8
commit
8658373dd9
@ -113,8 +113,12 @@ elseif(Win32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LUA_BUILD_BINARY)
|
if(LUA_BUILD_BINARY)
|
||||||
include(CheckIncludeFile)
|
include(CheckLibraryExists)
|
||||||
CHECK_INCLUDE_FILE("readline/readline.h" HAVE_READLINE_READLINE_H)
|
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)
|
||||||
|
|
||||||
add_executable(lua "src/lua.c")
|
add_executable(lua "src/lua.c")
|
||||||
# Can not use lua_shared because some symbols are not exported
|
# Can not use lua_shared because some symbols are not exported
|
||||||
@ -122,11 +126,13 @@ if(LUA_BUILD_BINARY)
|
|||||||
set_target_properties(lua PROPERTIES
|
set_target_properties(lua PROPERTIES
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}
|
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
if (HAVE_READLINE_READLINE_H)
|
if (HAVE_LIBRARY_READLINE)
|
||||||
target_compile_definitions(lua PRIVATE "LUA_USE_READLINE")
|
target_compile_definitions(lua PRIVATE "LUA_USE_READLINE")
|
||||||
target_link_libraries(lua PUBLIC readline)
|
target_link_libraries(lua PUBLIC readline)
|
||||||
|
if (HAVE_LIBRARY_TINFO)
|
||||||
target_link_libraries(lua PUBLIC tinfo)
|
target_link_libraries(lua PUBLIC tinfo)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
list(APPEND TARGETS_TO_INSTALL lua)
|
list(APPEND TARGETS_TO_INSTALL lua)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user