From: Shuanglei Tao Date: Thu, 18 Aug 2022 06:37:55 +0000 (+0800) Subject: cmake: add check for util lib X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=b31ac86a27e058c3b1c6d9cf0cf9f25d9ce9ce4f;p=ttyd.git cmake: add check for util lib --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 919c983..ae540d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,8 +82,11 @@ if(WIN32) list(APPEND LINK_LIBS shell32 ws2_32) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/app.rc.in ${CMAKE_CURRENT_BINARY_DIR}/app.rc @ONLY) list(APPEND SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/app.rc) -elseif(NOT APPLE) - list(APPEND LINK_LIBS util) +else() + find_library(LIBUTIL NAMES util) + if(LIBUTIL) + list(APPEND LINK_LIBS util) + endif() endif() add_executable(${PROJECT_NAME} ${SOURCE_FILES})