Disable Linenoise on Windows.

There are various forks of Linenoise with Windows support, but none
compile cleanly with all compilers. For now, just disable it.
This commit is contained in:
Grant Paul 2016-11-20 19:10:38 -08:00 committed by onhachoe
parent 1e95a6bb5e
commit eecca45796

View File

@ -84,17 +84,21 @@ add_executable(PlistBuddy Tools/PlistBuddy.cpp)
target_link_libraries(PlistBuddy PRIVATE plist util)
install(TARGETS PlistBuddy DESTINATION usr/bin)
set(LINENOISE_ROOT "${CMAKE_SOURCE_DIR}/ThirdParty/linenoise")
set(LINENOISE_SOURCE "${LINENOISE_ROOT}/linenoise.c")
if (EXISTS "${LINENOISE_SOURCE}")
add_library(linenoise "${LINENOISE_SOURCE}")
target_include_directories(linenoise PUBLIC "${LINENOISE_ROOT}")
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
target_compile_definitions(linenoise PRIVATE _GNU_SOURCE)
endif ()
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
# TODO
else ()
set(LINENOISE_ROOT "${CMAKE_SOURCE_DIR}/ThirdParty/linenoise")
set(LINENOISE_SOURCE "${LINENOISE_ROOT}/linenoise.c")
if (EXISTS "${LINENOISE_SOURCE}")
add_library(linenoise "${LINENOISE_SOURCE}")
target_include_directories(linenoise PUBLIC "${LINENOISE_ROOT}")
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
target_compile_definitions(linenoise PRIVATE _GNU_SOURCE)
endif ()
target_link_libraries(PlistBuddy PRIVATE linenoise)
target_compile_definitions(PlistBuddy PRIVATE HAVE_LINENOISE)
target_link_libraries(PlistBuddy PRIVATE linenoise)
target_compile_definitions(PlistBuddy PRIVATE HAVE_LINENOISE)
endif ()
endif ()
if (BUILD_TESTING)