Skip to content

Commit

Permalink
CMake: make readline support configurable, not automatic
Browse files Browse the repository at this point in the history
Otherwise if it's detected on the system (e.g. if you install GnuWin)
then it would always be enabled, but linking against GnuWin headers
breaks the build.
  • Loading branch information
qris committed Jul 23, 2017
1 parent efea1d0 commit c5e9e11
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions infrastructure/cmake/CMakeLists.txt
Expand Up @@ -419,9 +419,13 @@ else()
endif()
endif()

# Enable the readline option (BOX_SUPPORT_READLINE), on by default, if readline is detected.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
find_package(Readline)
if(READLINE_FOUND)
option(BOX_SUPPORT_READLINE "Enable support for linking with libreadline." ON)
endif()
if(BOX_SUPPORT_READLINE)
include_directories(${Readline_INCLUDE_DIR})
target_link_libraries(lib_common PUBLIC ${Readline_LIBRARY})
endif()
Expand Down

0 comments on commit c5e9e11

Please sign in to comment.